From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2005-03-15 12:15:40
"Peter Dimov" <pdimov_at_[hidden]> wrote in message
> 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
> 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
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?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk