STX  1.0.0
List of all members
stx::SourceLocation Struct Reference

#include <source_location.h>

Detailed Description

The SourceLocation class represents certain information about the source code, such as file names, line numbers, and function names. Previously, functions that desire to obtain this information about the call site (for logging, testing, or debugging purposes) must use macros so that predefined macros like __LINE__ and __FILE__ are expanded in the context of the caller. The SourceLocation class provides a better alternative.

based on: https://en.cppreference.com/w/cpp/utility/source_location

Constructor & Destructor Documentation

◆ SourceLocation() [1/3]

constexpr stx::SourceLocation::SourceLocation ( )
inlinenoexcept

◆ SourceLocation() [2/3]

constexpr stx::SourceLocation::SourceLocation ( SourceLocation const &  other)
defaultnoexcept

◆ SourceLocation() [3/3]

constexpr stx::SourceLocation::SourceLocation ( SourceLocation &&  other)
defaultnoexcept

◆ ~SourceLocation()

stx::SourceLocation::~SourceLocation ( )
defaultnoexcept

Member Function Documentation

◆ column()

constexpr uint_least32_t stx::SourceLocation::column ( ) const
inlinenoexcept

return the column number represented by this object

◆ current()

static constexpr SourceLocation stx::SourceLocation::current ( const char *  file = "unknown",
const char *  func = "unknown",
uint_least32_t  line = 0,
uint_least32_t  column = 0 
)
inlinestaticnoexcept

◆ file_name()

constexpr const char* stx::SourceLocation::file_name ( ) const
inlinenoexcept

return the file name represented by this object

◆ function_name()

constexpr const char* stx::SourceLocation::function_name ( ) const
inlinenoexcept

return the name of the function represented by this object, if any

◆ line()

constexpr uint_least32_t stx::SourceLocation::line ( ) const
inlinenoexcept

return the line number represented by this object

◆ operator=() [1/2]

constexpr SourceLocation& stx::SourceLocation::operator= ( SourceLocation const &  other)
defaultnoexcept

◆ operator=() [2/2]

constexpr SourceLocation& stx::SourceLocation::operator= ( SourceLocation &&  other)
defaultnoexcept

The documentation for this struct was generated from the following file: