00001 00002 // The Loki Library 00003 // Copyright (c) 2006 Richard Sposato 00004 // Copyright (c) 2006 Peter Kümmel 00005 // Permission to use, copy, modify, distribute and sell this software for any 00006 // purpose is hereby granted without fee, provided that the above copyright 00007 // notice appear in all copies and that both that copyright notice and this 00008 // permission notice appear in supporting documentation. 00009 // The authors make no representations about the 00010 // suitability of this software for any purpose. It is provided "as is" 00011 // without express or implied warranty. 00013 #ifndef LOKI_CONST_POLICY_INC_ 00014 #define LOKI_CONST_POLICY_INC_ 00015 00016 // $Id: ConstPolicy.h 769 2006-10-26 10:58:19Z syntheticpp $ 00017 00018 00019 namespace Loki 00020 { 00021 00026 00027 00034 00035 template< class T > 00036 struct DontPropagateConst 00037 { 00038 typedef T Type; 00039 }; 00040 00047 00048 template< class T > 00049 struct PropagateConst 00050 { 00051 typedef const T Type; 00052 }; 00053 00054 // default will not break existing code 00055 #ifndef LOKI_DEFAULT_CONSTNESS 00056 #define LOKI_DEFAULT_CONSTNESS ::Loki::DontPropagateConst 00057 #endif 00058 00059 } // end namespace Loki 00060 00061 #endif // end file guardian