Boost logo

Boost :

From: vesa_karvonen (vesa_karvonen_at_[hidden])
Date: 2002-02-22 03:16:33

--- In boost_at_y..., "David Abrahams" <david.abrahams_at_r...> wrote:
> There are a number of type properties like is_POD which should
> probably be propagated through arrays and cv-qualifications:

I would personally try to avoid specializing traits for each T, T c,
T v and T cv. I would specialize only for T cv and use the type
transformation traits to add cv qualifications. I'm not worried about
compilers whose template recursion depth is small by default. Those
compiler will be fixed or already have an option to increase the

template<class t>
struct is_integral
{ enum
  { value =
      < typename add_volatile
        < typename add_const<t>::type

// This could also be put into the detail namespace
template<class T>
struct is_integral_cv
{ enum { value = false }; };

  ( 9\
  , ( char\
    , signed char\
    , unsigned char\
    , short\
    , unsigned short\
    , int\
    , unsigned\
    , long\
    , unsigned long\

  struct is_integral_cv<T const volatile>\
  {enum {value = true};};


Even after adding the standard wchar_t and other non-standard
integral types, this would be much much shorter than the current
is_integral implementation.

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