Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2007-01-21 07:31:49


Dmitry Ivankov wrote:
> Hmm, maybe std::numeric_limits isn't specialized for classes?
> In that case it's possible to use it only for non-classes.
>
> Looks like that 18.2.1/1 and 18.2.1/4 states that numeric_limits is
> only for fundamental types.
>
> So maybe just fix lexical_cast so that it won't use
> std::numeric_limits for classes?

numeric_limits *can* be specialised for user defined types, and IMO
lexical_cast should use the information.

If the only issue is abstract types, can't we simply filter out abstract
types before invoking numeric_limits? Note that on compilers that don't
support is_abstract fully the class defaults to the same behaviour as
is_polymorphic, and while that may then filter out some classes that
shouldn't be on broken compilers, it's a quite reasonable compromise.

John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk