
The Standard C++ Library describes a specific type by providing a specialization of the numeric_limits template for the type. Static member functions and static constant data members then provide information specific to the type. The Standard C++ Library includes descriptions of the fundamental datatypes given in Table 20.
| bool | char | int | float |
signed char | short | double | |
unsigned char | long | long double | |
wchar_t | |||
unsigned short | |||
unsigned int | |||
unsigned long |
Certain implementations may also provide information on other datatypes. Whether or not an implementation is described can be discovered using the static data member is_specialized. For example, the following is legal, and will indicate that the string datatype is not described by this mechanism.
std::cout << "are strings described " << std::numeric_limits<string>::is_specialized << std::endl;
For datatypes that do not have a specialization, the values yielded by the functions and data members in numeric_limits are generally zero or false.
Copyright (c) 1994-2006 Rogue Wave Software, a Quovadx Division.
Licensed under the Apache License, Version 2.0.
Contact Rogue Wave about documentation or support issues. You can also seek help from other developers through the Apache stdcxx community (see below).