> Suppose I'm writing some generic piece of numeric code that can be > instantiated with a User Defined Type (UDT). > And further suppose that I need to detect whether the generic numeric type > represents either integer or floating point values. > Can I use type_traits is_integral<> (or is_float<>)? That is, is the user > allowed to provide her own specializations of this templates? > If not, how should I let the user tell whether her numeric UDT is > integer/float/signed/etc...?
No, is_integer and is_float etc are for built-in types *only*. If you want to detect UDT's that are pretending to be numbers, then you should use std::numeric_limits<>, and provide a specialisation for these if required. John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost