std::numeric_limits<T>::has_infinity_C++中文网
| static const bool has_infinity; |
(C++11 前) | |
| static constexpr bool has_infinity; |
(C++11 起) | |
std::numeric_limits<T>::has_infinity 的值对所有能够表示正无穷大为独立特殊值的类型 T 为 true 。此常量对所有浮点类型有意义,且保证若 std::numeric_limits<T>::is_iec559 == true 则为 true 。
标准特化
T
|
std::numeric_limits<T>::has_infinity 的值 |
| /* non-specialized */ | false |
| bool | false |
| char | false |
| signed char | false |
| unsigned char | false |
| wchar_t | false |
| char8_t | false |
| char16_t | false |
| char32_t | false |
| short | false |
| unsigned short | false |
| int | false |
| unsigned int | false |
| long | false |
| unsigned long | false |
| long long | false |
| unsigned long long | false |
| float | 通常为 true |
| double | 通常为 true |
| long double | 通常为 true |