Summary
This episode continues Jason's series on modernizing C++ code, focusing on migrating from C++14 to C++17. He demonstrates powerful C++17 features including the [[nodiscard]] attribute for preventing discarded return values, std::string_view for avoiding unnecessary string allocations, std::from_chars for string parsing, default member initializers, and std::gcd/std::lcm for mathematical operations. The episode also shows how replacing std::string with std::string_view enables making more functions constexpr while simultaneously improving performance by reducing allocations.
Related C++ Standard Sections
This episode covers topics found in these sections of the C++ standard:
-
[charconv]40% match -
[numeric.ops.gcd]40% match -
[numeric.ops.lcm]40% match