
21 Dec
2012
21 Dec
'12
3:13 p.m.
On Fri, Dec 21, 2012 at 2:14 PM, cdmh
(v11). I used boost::is_signed<T>::value where T is double and it evaluates to false, but I expected true as double can hold negative numbers.
Quoting the documentation for boost::is_unsigned [1]: "Inherits: If T is an signed integer type or an enumerated type with an underlying signed integer type, then inherits from true_type, otherwise inherits from false_type." So, boost::is_signed will only ever be true for integer types (and similarly for is_unsigned). You might want to additionally use boost::is_floating_point, as AFAIK, there are no unsigned floating point types. Best, Mika [1] http://www.boost.org/doc/libs/1_52_0/libs/type_traits/doc/html/boost_typetra...