From Jason Turner
Watch on YouTube

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++.

Resources

Tags