C++ Templates Revised
summary
Second edition integrates Modern C++ and shows concrete fixes and patterns for real code: use inline constexpr static members to avoid ODR linker errors for trait values, prefer type-based traits or void_t for SFINAE, and consider Boost.Hana style is_valid helpers to cut boilerplate. Beware of string_view nightmare causing dangling views and prefer auto return types or decltype(auto) for perfect forwarding combined with invoke_result_t and if constexpr to handle void and nonvoid paths. Examples compile on current compilers and nested variadic patterns demonstrate practical CRTP and pack expansion uses.
AI-written summary · about
chapters (8)
- 0:00Introduction to C++ templates
- 3:13History of the C++ Templates book
- 13:50Evolution of Type Traits in C++
- 23:42Strings and auto in templates
- 35:06Passing arguments by value vs reference
- 47:09Return types and string_view pitfalls
- 53:05If constexpr and compiler checks
- 58:08Summary of C++ template features
