std::experi...ion::column(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

🌸 NAME 🌸

Okay bestie, welcome to the page for std::experi...ion::column(3) from the C++ Standard Libary manual. The NAME line is std::experimental::source_location::column - std::experimental::source_location::column, and yes she is self-titled, iconic, and fully unbothered. πŸ‘‘πŸ’…

πŸŽ€ Synopsis πŸŽ€

constexpr std::uint_least32_t column() const noexcept;  (library
fundamentals TS v2)

That's the whole signature, no cap. constexpr, std::uint_least32_t, const noexcept, and the library fundamentals TS v2 era all right there. ✨

🫢 Parameters 🫢

  • (none) β€” literally zero parameters, not a single one to pass. πŸ“

✨ Return value ✨

An implementation-defined value representing some offset from the start of the line represented by this object (i.e., the column number). 🌈

πŸ’– Example πŸ’–

// Run this code

        #include <experimental/source_location>
        #include <iostream>

        template<typename T = std::experimental::source_location>
        inline void pos(const T& location = T::current())
        {
            std::cout
                << "("
                << location.line()
                << ':'
                << location.column()
                << ") ";
        }

        int main()
        {
            pos(); std::cout << "Proxima\n";
            pos(); std::cout << "Centauri\n";
        }

πŸ¦‹ Possible output πŸ¦‹

        (17:5) Proxima
        (18:5) Centauri

πŸ’œ See also πŸ’œ

  • line β€” return the line number represented by this object (public member function)
  • file_name β€” return the file name represented by this object (public member function)
  • function_name β€” return the name of the function represented by this object, if any (public member function)
  • C++ documentation for Filename and line information

That's the whole vibe, bestie. Source/version + date, for the record: http://cppreference.com, 2024.06.10. πŸŽ€πŸ’–πŸ¦‹

πŸ“¦ where this page comes from