Namespaces
Variants

std::numeric_limits<T>::is_specialized

cppreference.net에서 가져옴
 
 
유틸리티 라이브러리
일반 유틸리티
관계 연산자 (C++20에서 폐기됨)
정수 비교 함수
(C++20)(C++20)(C++20)    
(C++20)
교체 및 타입 연산
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
공통 어휘 타입
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)



 
 
 
static const bool is_specialized;
(C++11까지)
static constexpr bool is_specialized;
(C++11부터)

std::numeric_limits<T>::is_specialized의 값은 true입니다. 이는 T에 대해 std::numeric_limits의 특수화가 존재하는 모든 경우에 해당합니다.

표준 특수화

T std:: numeric_limits < T > :: is_specialized 의 값
/* non-specialized */ false
bool true
char true
signed char true
unsigned char true
wchar_t true
char8_t (C++20부터) true
char16_t (C++11부터) true
char32_t (C++11부터) true
short true
unsigned short true
int true
unsigned int true
long true
unsigned long true
long long (C++11부터) true
unsigned long long (C++11부터) true
float true
double true
long double true

예제

#include <iostream>
#include <limits>
#include <type_traits>
int main()
{
    enum E{};
    std::cout << std::boolalpha
              << std::numeric_limits<bool>::is_specialized << '\n'
              << std::numeric_limits<long long>::is_specialized << '\n'
              << std::numeric_limits<std::true_type>::is_specialized << '\n'
              << std::numeric_limits<E>::is_specialized << '\n';
}

가능한 출력:

true
true
false
false

참고 항목

[static]
정수형 식별
(public static member constant)
[static]
IEC 559/IEEE 754 부동소수점 형식 식별
(public static member constant)
[static]
정확한 형식 식별
(public static member constant)
[static]
유한한 값들의 집합을 나타내는 형식 식별
(public static member constant)