std::numeri..._specialized(3)
okay so bestie, welcome to the C++ Standard Libary manual β yes, that spelling is exactly what the header says β and this page is std::numeri..._specialized(3). We're here for std::numeric_limits::is_specialized, and it's giving tiny-but-iconic boolean main character energy. π
β¨
π NAME
std::numeric_limits::is_specialized-std::numeric_limits::is_specializedβ that's literally the name, bestie. No notes, it ate.
β¨ Synopsis
The synopsis has two eras, because of course it does:
static const bool is_specialized; (until C++11)
static constexpr bool is_specialized; (since C++11)
And the actual tea: the value of std::numeric_limits<T>::is_specialized is true for all T for which there exists a specialization of std::numeric_limits. periodt. π
πΈ Standard specializations
Here's the full roster β T on the left, value of std::numeric_limits<T>::is_specialized on the right:
/* non-specialized */βfalseboolβtruecharβtruesigned charβtrueunsigned charβtruewchar_tβtruechar8_t(since C++20) βtruechar16_t(since C++11) βtruechar32_t(since C++11) βtrueshortβtrueunsigned shortβtrueintβtrueunsigned intβtruelongβtrueunsigned longβtruelong long(since C++11) βtrueunsigned long long(since C++11) βtruefloatβtruedoubleβtruelong doubleβtrue
π Example
The page says // Run this code, so obviously we run it, bestie:
#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';
}
Possible output:
true
true
false
false
π¦ See also
Each of these is also [static] β (public static member constant), iykyk:
is_integerβ identifies integer types.[static](public static member constant).is_iec559β identifies the IEC 559/IEEE 754 floating-point types.[static](public static member constant).is_exactβ identifies exact types.[static](public static member constant).is_boundedβ identifies types that represent a finite set of values.[static](public static member constant).
mwah π β source/version: http://cppreference.com, dated 2024.06.10, page std::numeri..._specialized(3). slay and goodbye π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms