Namespaces
Variants

std::meta::has_template_arguments

cppreference.net에서
< cpp | meta
 
 
 
반영 라이브러리
 
반영 타입 및 쿼리
반영 쿼리
반영 레이아웃 쿼리
타입 속성
타입 속성 쿼리
 
헤더에 정의됨 <meta>
consteval bool has_template_arguments( std::meta::info r );
(C++26부터)

만약 r이 함수 템플릿, 변수 템플릿, 클래스 템플릿 또는 별칭 템플릿에 템플릿 인수를 치환하여 생성된 개체를 나타내면 true을 반환합니다. 그렇지 않으면 false을 반환합니다.

매개변수

r - 반영 값

반환값

true 만약 r이 템플릿에서 인스턴스화된 개체를 나타내면, 그렇지 않으면 false.

참고

만약 has_template_arguments(r)이 true이면, 함수 std::meta::template_of 및 std::meta::template_arguments_of는 각각 해당 템플릿과 템플릿 인수를 반환합니다.

예제

#include <meta>
#include <string>
#include <vector>

static_assert(has_template_arguments(^^std::vector<int>));
static_assert(!has_template_arguments(^^std::string));
static_assert(has_template_arguments(std::meta::dealias(^^std::string)));

int main() {}

같이 보기

Template:cpp/meta/dsc is template