std::vector<int> v(1'000'000); std::for_each(std::execution::par, v.begin(), v.end(), [](int& x) x *= 2; ); Portable filesystem operations: paths, directories, permissions, etc.

std::optional<int> parse_int(const std::string& s) try return std::stoi(s); catch(...) return std::nullopt;

Compile-time conditional compilation inside templates, discarding non-taken branches entirely.

std::map<int, std::string> m = 1, "a"; for (const auto& [key, val] : m) // key = 1, val = "a" std::cout << key << ": " << val << '\n';

More from this show

c++ 2017 Episode 270

Navigating Struggle: Simple Routines and Sleep Strategies for ADHD

C++ 2017 -

std::vector<int> v(1'000'000); std::for_each(std::execution::par, v.begin(), v.end(), [](int& x) x *= 2; ); Portable filesystem operations: paths, directories, permissions, etc.

std::optional<int> parse_int(const std::string& s) try return std::stoi(s); catch(...) return std::nullopt; c++ 2017

Compile-time conditional compilation inside templates, discarding non-taken branches entirely. [](int& x) x *= 2

std::map<int, std::string> m = 1, "a"; for (const auto& [key, val] : m) // key = 1, val = "a" std::cout << key << ": " << val << '\n'; Portable filesystem operations: paths

Subscribe

Episode 271