Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:44:54

0001 // The code below strips away various qualifiers from a type
0002 
0003 #ifndef GENERS_STRIPPEDTYPE_HH_
0004 #define GENERS_STRIPPEDTYPE_HH_
0005 
0006 #include <utility>
0007 
0008 namespace gs {
0009   template <class T>
0010   struct StrippedType {
0011     typedef T type;
0012   };
0013 
0014   template <class T>
0015   struct StrippedType<T const> {
0016     typedef T type;
0017   };
0018 
0019   template <class T>
0020   struct StrippedType<T volatile> {
0021     typedef T type;
0022   };
0023 
0024   template <class T>
0025   struct StrippedType<T const volatile> {
0026     typedef T type;
0027   };
0028 
0029   template <class T, class U>
0030   struct StrippedType<std::pair<T, U>> {
0031     typedef std::pair<typename StrippedType<T>::type, typename StrippedType<U>::type> type;
0032   };
0033 
0034   template <class T, class U>
0035   struct StrippedType<const std::pair<T, U>> {
0036     typedef std::pair<typename StrippedType<T>::type, typename StrippedType<U>::type> type;
0037   };
0038 
0039   template <class T, class U>
0040   struct StrippedType<volatile std::pair<T, U>> {
0041     typedef std::pair<typename StrippedType<T>::type, typename StrippedType<U>::type> type;
0042   };
0043 
0044   template <class T, class U>
0045   struct StrippedType<const volatile std::pair<T, U>> {
0046     typedef std::pair<typename StrippedType<T>::type, typename StrippedType<U>::type> type;
0047   };
0048 }  // namespace gs
0049 
0050 #endif  // GENERS_STRIPPEDTYPE_HH_