removeConst< T > Struct Template Reference

typename removeConst<T>::type is a type that is the non-const version of T. For normal classes, removeConst<T>::type is the same as T, but for T which is const, type is the non-const form. More...

#include <classTraits.h>

List of all members.

Public Types

typedef isConstType< T >::type type

Detailed Description

template<class T>
struct cxxtls::removeConst< T >

typename removeConst<T>::type is a type that is the non-const version of T. For normal classes, removeConst<T>::type is the same as T, but for T which is const, type is the non-const form.

The following templates, removeConst<T>, removeVolatile<T>, and removeCV<T> let you define a typedef based on some specified type BUT not having the const or volatile attributes. Use it like this:

  
      template<class T>
      void function(T t)
      {
         typedef typename removeCV<T>::type PlainOldT;
  
         // use PlainOldT instead of T to eliminate annoying and unnecessary
         // template specializations of T which have const or volatile attributes.
      }
  
    
See also:
classTraits_documentation

Definition at line 275 of file classTraits.h.


Member Typedef Documentation

typedef isConstType<T>::type type

Definition at line 300 of file classTraits.h.


The documentation for this struct was generated from the following file:
Generated on Wed Feb 29 22:56:12 2012 for CXXUtilities by  doxygen 1.6.3