Summary
This episode explores C++20's std::source_location, a powerful new feature for compile-time source code introspection. Jason demonstrates how this feature provides file names, line numbers, column positions, and function signatures at the call site without relying on preprocessor macros. The episode shows how std::source_location works with different contexts including templates and lambdas, revealing its potential for creating better logging mechanisms and enabling rudimentary reflection capabilities in C++.
Related C++ Standard Sections
This episode covers topics found in these sections of the C++ standard:
-
[support.srcloc.class]40% match