Boost logo

Boost Users :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2004-04-30 06:33:00

John Maddock wrote:
> > It seems to me that it would be better still to put
> >
> > BOOST_STATIC_ASSERT(is_same<unsigned short, wchar_t>::value);
> > #else
> > BOOST_STATIC_ASSERT(!is_same<unsigned short, wchar_t>::value);
> > #endif
> >
> > after the conditional definition of BOOST_NO_INTRINSIC_WCHAR_T to
> > verify that the macro has been set/unset correctly.
> Not a bad idea, but it brings in a lot of type-traits code that may not
> actually be needed...

Actually, it could be as simple as

template< typename T > struct assert_no_intrinsic_wchar_t;
template<> struct assert_no_intrinsic_wchar_t<wchar_t> { typedef void type; };
typedef assert_no_intrinsic_wchar_t<unsigned short>::type assert_no_intrinsic_wchar_t_;
template< typename T > struct assert_intrinsic_wchar_t;
template<> struct assert_intrinsic_wchar_t<wchar_t> {};
template<> struct assert_intrinsic_wchar_t<unsigned short> {};

With an appropriate comment as suggested by Christopher, it'd be a noticable
improvement over the status quo.

Aleksey Gurtovoy
MetaCommunications Engineering

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at