18.3.2.1/2:
Specializations must be provided for each arithmetic type, as a floating point and integer, including bool. The is_specialized member must be true for all such numeric_limits specializations.
So, we know that specializations will exist for these types without reference. Then 18.3.2.3/1:
The default numeric_limits template must have all members, but with 0 or false values.
I suspect this was done because you can always static_assert on is_specialized to force compilation, but there might be some kind of template application where 0 will be the default default for one or more constraints. If you want to be able to test links, just run it via std::remove_reference .
I'm not sure if the specialization of numeric_limits is legal for your own types. The standard in 18.3.2.1/4 states:
Non-arithmetic standard types, such as complex (26.4.2), should not be specialized.
I personally read this qute as "the standard will not provide specializations for non-arithmetic standard libray types, but it is completely legal for specialization for a user type." You can read it just as easily as completely disallowing any specializations not provided.
source share