Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2003-04-25 11:28:21

On Fri, 25 Apr 2003 11:25:15 -0400, David Abrahams
<dave_at_[hidden]> wrote:

>OK, what if it were changed to:
># if !(defined(_WCHAR_T_DEFINED) || defined(_NATIVE_WCHAR_T_DEFINED))
># endif

No. I don't know if the meaning of _WCHAR_T_DEFINED has been changed
with the latest VC and/or Intel but certainly the above doesn't work
with version 6, of both compilers. The point is that _WCHAR_T_DEFINED
isn't actually an indicator of intrinsic-ness; it gets, for instance,
manually defined in the library headers:

 typedef unsigned short wchar_t;

Client code assumes that wchar_t is a distinct type, unless
BOOST_NO_INTRINSIC_WCHAR_T is defined. So the above change would break
the typical usage:

  template <typename T>
  struct is_integral
  { static const bool value = false; };

  template <>
  struct is_integral<unsigned short>
  { static const bool value = true; };


 // Oops... _WCHAR_T_DEFINED is defined,
 // but you can't (re-)specialize

 template <>
 struct is_integral<wchar_t>
 { static const bool value = true; };



Boost list run by bdawes at, gregod at, cpdaniel at, john at