std::source_location(3cxx)
π std::source_location β aka the 3cxx page from the libstdc++ manual π
okay bestie, pull up a chair, because this one is genuinely iconic. it's std::source_location, and it lives in the libstdc++ section 3cxx of the manual. say it with me: source. location. the vibe is "where am i, actually, in the code." πΊοΈβ¨
πΈ NAME πΈ
std::source_location β a class that describes a location in source code. that's it, that's the whole job, and she does it flawlessly. π
β¨ SYNOPSIS β¨
#include <source_location>
that's the include. that's literally all you need to start the journey. go off. π
π«Ά Public Member Functions
constexpr uint_least32_t column () const noexceptconstexpr const char * file_name () const noexceptconstexpr const char * function_name () const noexceptconstexpr uint_least32_t line () const noexcept
four little baddies. all constexpr, all noexcept, all giving exactly what they say on the tin. no drama, no surprises, just pure information. π
π§ Static Public Member Functions
static consteval source_location current (__builtin_ret_type __p=__builtin_source_location()) noexcept
this is the one. the main character. consteval, noexcept, and it takes __p defaulting to __builtin_source_location(). look at that default argument, she's serving πβ¨
Detailed Description
A class that describes a location in source code. π
(i know. it said it in NAME, it said it in the heading, and here it is again. the manual is thorough like that. respect.)
π Author π
Generated automatically by Doxygen for libstdc++ from the source code.
no human hand wrote this blurb, bestie β Doxygen did it herself, straight from the source, zero ghostwriters. π
and that's the whole page, end to end, no skips, no skimming, we read every line together like the icons we are. π
this was the std::source_location page, 3cxx section, courtesy of libstdc++ β auto-generated by Doxygen, and honestly? she ate. π«Άβ¨ bye bestie, go find your source location π¦π
π¦ where this page comes from
- ubuntu resolute: libstdc++-12-doc 12.5.0-9ubuntu1
- ubuntu resolute: libstdc++-13-doc 13.4.0-10ubuntu1
- ubuntu stonking: libstdc++-12-doc 12.5.0-9ubuntu1
- ubuntu stonking: libstdc++-13-doc 13.5.0-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms