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 noexcept
  • constexpr const char * file_name () const noexcept
  • constexpr const char * function_name () const noexcept
  • constexpr 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