00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 #ifndef MLN_METAL_CONST_HH
00027 # define MLN_METAL_CONST_HH
00028 
00036 # define mlc_const(T) typename mln::metal::const_< T >::ret
00037 
00038 # define mlc_const_return(T) typename mln::metal::const_return_< T >::ret
00039 
00040 
00041 
00042 namespace mln
00043 {
00044 
00045   namespace metal
00046   {
00047 
00048     
00049 
00050     template <typename T> struct const_ { typedef const T ret; };
00051     template <typename T> struct const_< const T        > { typedef const T ret; };
00052 
00053     template <typename T> struct const_<       T&       > { typedef const T& ret; };
00054     template <typename T> struct const_< const T&       > { typedef const T& ret; };
00055 
00056     template <typename T> struct const_<       T*       > { typedef const T* const ret; };
00057     template <typename T> struct const_< const T*       > { typedef const T* const ret; };
00058     template <typename T> struct const_<       T* const > { typedef const T* const ret; };
00059     template <typename T> struct const_< const T* const > { typedef const T* const ret; };
00060 
00061 
00062     
00063 
00064     template <typename T> struct const_return_ { typedef       T ret; };
00065     template <typename T> struct const_return_< const T        > { typedef       T ret; };
00066 
00067     template <typename T> struct const_return_<       T&       > { typedef const T& ret; };
00068     template <typename T> struct const_return_< const T&       > { typedef const T& ret; };
00069 
00070     template <typename T> struct const_return_<       T*       > { typedef const T* ret; };
00071     template <typename T> struct const_return_< const T*       > { typedef const T* ret; };
00072     template <typename T> struct const_return_<       T* const > { typedef const T* ret; };
00073     template <typename T> struct const_return_< const T* const > { typedef const T* ret; };
00074 
00075   } 
00076 
00077 } 
00078 
00079 
00080 #endif // ! MLN_METAL_CONST_HH