◐ Shell
clean mode source ↗

标准库标头 <source_location> (C++20) - cppreference.com

来自cppreference.com

此头文件是工具库的一部分。

概要

namespace std {
  struct source_location;
}

std::source_location

namespace std {
  struct source_location {
    // source_location  构造
    static consteval source_location current() noexcept;
    constexpr source_location() noexcept;

    // source_location 域访问
    constexpr uint_least32_t line() const noexcept;
    constexpr uint_least32_t column() const noexcept;
    constexpr const char* file_name() const noexcept;
    constexpr const char* function_name() const noexcept;

  private:
    uint_least32_t line_;               // 仅为阐释
    uint_least32_t column_;             // 仅为阐释
    const char* file_name_;             // 仅为阐释
    const char* function_name_;         // 仅为阐释
  };
}