
"Peter Dimov" <pdimov@mmltd.net> wrote in message news:017001c52980$40bcb9b0$6801a8c0@pdimov...
Gennadiy Rozental wrote:
If I try to print C literal this function is instantiated with char [N]. And if fails to instantiate std::numeric_limits<char [N]>.
Shouldn't numeric_limits work for any type?
No. "Specializations shall be provided for each fundamental type, both floating point and integer, including bool." "Non-fundamental standard types, such as complex<T> (26.2.2), shall not have specializations."
Since numeric_limits is not specialized for arrays, the primary template is used, which is ill-formed.
Ok. So, how could I use numeric_limits in generic function? In my particular case I need to set a precision for FP types based on information from numeric limits. Gennadiy. P.S. BTW, does it says anywhere that primary template is required to be ill-format for array types? Could STL implementers does a better job?