volatile_trait.h
Go to the documentation of this file.00001 #ifndef _SIGX_VOLATILE_TRAIT_H_
00002 #define _SIGX_VOLATILE_TRAIT_H_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 namespace sigx
00031 {
00032
00039 template<typename T_type>
00040 struct volatile_trait
00041 {
00042 typedef volatile T_type add;
00043 typedef T_type remove;
00044 };
00045
00048 template<typename T_type>
00049 struct volatile_trait<volatile T_type>
00050 {
00051 typedef volatile T_type add;
00052 typedef T_type remove;
00053 };
00054
00095 template<typename T_type>
00096 struct volatile_trait<T_type&>
00097 {
00098 typedef volatile T_type& add;
00099 typedef T_type& remove;
00100 };
00101
00104 template<typename T_type>
00105 struct volatile_trait<volatile T_type&>
00106 {
00107 typedef volatile T_type& add;
00108 typedef T_type& remove;
00109 };
00110
00111
00112
00113 template<typename T, typename T_src>
00114 T volatile_cast(T_src& tsrc)
00115 {
00116 return const_cast<T>(tsrc);
00117 }
00118
00119
00120
00121
00125 }
00126
00127
00128 #endif // end file guard