|
Boost Users : |
Subject: [Boost-users] Is 'double' a signed type? (boost type traits)
From: cdmh (cdm.henderson_at_[hidden])
Date: 2012-12-21 08:14:48
Hi,
I have found some surprising behaviour with boost type traits using MSVC2012
(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.
More surprisingly, I found that, for double, is_unsigned is not the inverse
of is_signed, and hence this static assert produces a compiler error.
BOOST_STATIC_ASSERT(boost::is_unsigned<double>::value ==
!boost::is_signed<double>::value);
I am missing a rationale for this, or it is a bug?
Thanks
-- Craig
-- View this message in context: http://boost.2283326.n4.nabble.com/Is-double-a-signed-type-boost-type-traits-tp4640451.html Sent from the Boost - Users mailing list archive at Nabble.com.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net