std::experimental::reflect::get_source_line
From cppreference.com
< cpp | experimental | reflect
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Experimental
Filesystem library (filesystem TS)
Library fundamentals (library fundamentals TS)
Library fundamentals 2 (library fundamentals TS v2)
Library fundamentals 3 (library fundamentals TS v3)
Extensions for parallelism (parallelism TS)
Extensions for parallelism 2 (parallelism TS v2)
Extensions for concurrency (concurrency TS)
Extensions for concurrency 2 (concurrency TS v2)
Concepts (concepts TS)
Ranges (ranges TS)
Reflection (reflection TS)
Mathematical special functions (special functions TR)
Extensions for reflection
Concepts
Meta-object operations
Object
get_source_line
ObjectSequence
Named
Alias
Type
ScopeMember
RecordMember
and Base
Record
Enum
Variable
FunctionParameter
Callable
Variable
and Callable
Namespace
and Callable
ParenthesizedExpression
FunctionCallExpression
FunctionalConversion
Variable
and Function
MemberFunction
Record
and MemberFunction
Variable
and MemberFunction
Lambda
LambdaCapture
Defined in header
<experimental/reflect>
template< Object T >
struct get_source_line;
(reflection TS)
struct get_source_line;
Provides the member constant value
equal to the presumed line number of the declaration of the entity or typedef-name reflected by T
.
Contents
[edit] Helper variable template
template< class T >
constexpr auto get_source_line_v = get_source_line<T>::value;
(reflection TS)
constexpr auto get_source_line_v = get_source_line<T>::value;
Inherited from std::integral_constant
Member constants
value
[static]
T
(public static member constant)
Member functions
operator std::uint_least32_t
(public member function)
operator()
(C++14)
(public member function)
Member types
Type
Definition
value_type
std::uint_least32_t
type
std::integral_constant <std::uint_least32_t, value>
[edit] Example
The following code shows the source code line of an object or a class.
Run this code
Output:
6 7
[edit] See also
return the line number represented by this object
(public member function of
(public member function of
std::source_location
) [edit]
gets the line number that lexically relates the evaluation represented by the
(public member function of
stacktrace_entry
(public member function of
std::stacktrace_entry
) [edit]