Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-01-21 23:04:39


On /every/ compiler I can test, the following fails:

    BOOST_STATIC_ASSERT(boost::is_signed_integral<char>::value ==
boost::detail::is_signed<char>::value);

With the following definition:

namespace boost { namespace detail {

  template <class Number>
  struct is_signed
  {
      enum { value = (Number(-1) < Number(0)) };
  };
}}

Something wacky is going on here.

-Dave

----- Original Message -----
From: "Howard Hinnant" <hinnant_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Sunday, January 21, 2001 9:19 PM
Subject: Re: [boost] More type_traits confusion

> David Abrahams wrote on 1/21/2001 9:13 PM
> >> Note that is_signed<char>::value is both well formed and well-defined,
> >> though its result will vary with implementations.
> >
> >I think you should look again. For CW and GCC, is_signed<char>::value
> >reports false, even though chars are signed.
>
> I can't speak for gcc, but I'm not duplicating your results for cw. My
> tests are showing that cw reports true for is_signed<char>::value unless
> "Use Unsigned Chars" is checked in the language prefs panel, in which
> case it reports false (both PPC and Windows).
>
> -Howard
>
>
>


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