noconst.h

Go to the documentation of this file.
00001 #ifndef DVXML_NOCONST_H
00002 #define DVXML_NOCONST_H
00003 // $Id: noconst.h,v 1.4 2008/01/07 14:45:20 dvermeir Exp $
00004 
00005 namespace Dv { 
00006   namespace Xml { 
00007     /** Utility template: noconst<T>::mutable_type is T if T is not
00008      * "const" and X if T is "const X".
00009      */ 
00010     template<typename T> 
00011       struct noconst { 
00012         /** Mutable_type is T if T is not "const" and X if T is "const X".  */ 
00013         typedef T mutable_type; 
00014       };
00015 
00016     /** Utility template: noconst<T>::mutable_type is T if T is not
00017      * "const" and X if T is "const X".
00018      */
00019     template<typename T> 
00020       struct noconst<const T> { 
00021         /** Mutable_type is T if T is not "const" and X if T is "const X".  */ 
00022         typedef T mutable_type; 
00023       };
00024 
00025     /** Utility template: noconst<T>::mutable_type is T if T is not
00026      * "const" and X if T is "const X".
00027      */
00028     template<typename T> 
00029       struct noconst<T*> { 
00030         /** Mutable_type is T if T is not "const" and X if T is "const X".  */ 
00031         typedef void mutable_type; 
00032       }; 
00033   }
00034 }
00035 #endif

dvxml-0.1.7 [ 7 January, 2008]