Boost logo

Boost :

From: Aleksey Gurtovoy (alexy_at_[hidden])
Date: 2001-03-08 06:12:50


How about adding the following (surprisingly missing :) type transformation
templates to our 'type traits' library?

// really wanted
template <typename T>
struct add_const {
  typedef typename ct_if<is_const<T>::value, T, T const>::type type;
};

// for completeness
template <typename T>
struct add_volatile {
  typedef typename ct_if<is_volatile<T>::value, T, T volatile>::type type;
};

// for completeness??
template <typename T>
struct add_cv {
  typedef typename add_const<typename add_volatile<T>::type>::type type;
};


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