Namespaces
Variants

std::experimental::reflect:: get_source_line

From cppreference.net
Extensions for reflection
Concepts
Meta-object operations
Variable
FunctionParameter
Callable
Variable and Callable
Namespace and Callable
ParenthesizedExpression
FunctionCallExpression
FunctionalConversion
Variable and Function
헤더 파일에 정의됨 <experimental/reflect>
template < Object T >
struct get_source_line ;
(reflection TS)

T 에 의해 반영된 엔티티나 typedef-name의 선언의 추정된 라인 번호 와 동일한 value 멤버 상수를 제공합니다.

목차

헬퍼 변수 템플릿

template < class T >
constexpr auto get_source_line_v = get_source_line < T > :: value ;
(리플렉션 TS)

std:: integral_constant 에서 상속됨

멤버 상수

value
[static]
T 가 반영하는 엔티티나 typedef-name의 선언의 추정된 줄 번호
(public static member constant)

멤버 함수

operator std::uint_least32_t
객체를 std:: uint_least32_t 로 변환하고 value 를 반환함
(public member function)
operator()
(C++14)
value 를 반환함
(public member function)

멤버 타입

타입 정의
value_type std:: uint_least32_t
type std:: integral_constant < std:: uint_least32_t , value >

예제

다음 코드는 객체나 클래스의 소스 코드 라인을 보여줍니다.

#include<experimental/reflect>
#include<iostream>
using refl = std::experimental::reflect;
float f;
struct P{};
int main()
{
    std::cout << refl::get_source_line_v<reflexpr(f)> << '\n';
    std::cout << refl::get_source_line_v<reflexpr(P)> << '\n';
}

출력:

6
7

참고 항목

이 객체가 나타내는 줄 번호를 반환합니다
( std::source_location 의 public 멤버 함수)
stacktrace_entry 가 나타내는 평가와 어휘적으로 관련된 줄 번호를 가져옵니다
( std::stacktrace_entry 의 public 멤버 함수)