17
Language support library
[support]
17.8
Source location
[support.srcloc]
17.8.2
Class
source_
location
[support.srcloc.class]
17.8.2.1
General
[support.srcloc.class.general]
🔗
namespace
std
{
struct
source_location
{
// source location construction
static
consteval
source_location current
(
)
noexcept
;
constexpr
source_location
(
)
noexcept
;
// source location field access
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_;
//
exposition only
uint_least32_t column_;
//
exposition only
const
char
*
file_name_;
//
exposition only
const
char
*
function_name_;
//
exposition only
}
;
}
1
#
The type
source_
location
meets the
Cpp17DefaultConstructible
,
Cpp17CopyConstructible
,
Cpp17CopyAssignable
,
Cpp17Swappable
, and
Cpp17Destructible
requirements (
[utility.
arg.
requirements]
,
[swappable.
requirements]
)
.
All of the following conditions are
true
:
(1.1)
is_
nothrow_
move_
constructible_
v
<
source_
location
>
(1.2)
is_
nothrow_
move_
assignable_
v
<
source_
location
>
(1.3)
is_
nothrow_
swappable_
v
<
source_
location
>
[
Note
1
:
The intent of
source_
location
is to have a small size and efficient copying