C++ 2017 Repack
struct MyStruct static inline const std::string name = "C++17"; // Works immediately ;
Before C++17, static member variables had to be defined outside the class definition in a .cpp file to avoid linker errors. Now, you can define them inline inside the class. c++ 2017
Major compilers implemented C++17 features progressively: struct MyStruct static inline const std::string name =
template<auto N> struct Foo ; Foo<42> f1; Foo<'c'> f2; // Works immediately
g++ -std=c++17 program.cpp clang++ -std=c++17 program.cpp cl /std:c++17 program.cpp # MSVC
template <typename T> auto to_string(const T& t) if constexpr (std::is_integral_v<T>) return std::to_string(t); else return std::string(t); // only instantiated if T is not integral
Portable filesystem operations: paths, directories, permissions, etc.