Explores C++20's std::source_location feature, which provides a macro-free way to capture source code metadata like filename, function name, and line number at compile time. Demonstrates how it simplifies assertion implementations by eliminating the need for preprocessor macros like __FUNCTION__. Investigates implementation
•4m read time• From andreasfertig.com
Table of contents
std::source_location in a nutshellC++20 to the rescueThe magic of std::source_locationHow to pass a std::source_location objectConclusionSort: