std::numeric_limits<T>::is_specialized
cppreference.net에서 가져옴
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) |