Support Class Library
A set of tools providing classes and utility
type_mod.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <type_traits>
4 
5 #define SCL_TYPEMOD(alias) \
6 template <class T>\
7 using alias##_t = typename std::alias<T>::type;
8 
9 namespace scl{
10  namespace tools{
11  namespace meta{
12  SCL_TYPEMOD(remove_cv)
13  SCL_TYPEMOD(remove_const)
14  SCL_TYPEMOD(remove_volatile)
15 
16  SCL_TYPEMOD(add_cv)
17  SCL_TYPEMOD(add_const)
18  SCL_TYPEMOD(add_volatile)
19 
20  SCL_TYPEMOD(remove_reference)
21  SCL_TYPEMOD(add_lvalue_reference)
22  SCL_TYPEMOD(add_rvalue_reference)
23 
24  SCL_TYPEMOD(remove_pointer)
25  SCL_TYPEMOD(add_pointer)
26 
27  SCL_TYPEMOD(make_signed)
28  SCL_TYPEMOD(make_unsigned)
29 
30  SCL_TYPEMOD(remove_extent)
31  SCL_TYPEMOD(remove_all_extents)
32 
33  SCL_TYPEMOD(decay)
34 
35  template <class T>
37 
38  namespace details{
43  template <class T>
44  struct NoOp{ using type = T; };
45  }
46 
47  template <class T>
48  using no_op_t = typename details::NoOp<T>::type;
49 
50 #ifdef SCL_ENABLE_DEPRECATED_TYPEMODS
51  SCL_TYPEMOD(result_of)
52 #endif
53  }
54  }
55 }
56 
57 #undef SCL_TYPEMOD
typename std::remove_reference< T >::type remove_reference_t
Definition: type_mod.h:20
Global namespace of the SCL.
Definition: alias.hpp:3
Type construct that exposes a single type that is its type argument.
Definition: type_mod.h:44
typename std::remove_cv< T >::type remove_cv_t
Definition: type_mod.h:12
remove_cv_t< remove_reference_t< T > > remove_cv_ref_t
Definition: type_mod.h:36
typename details::NoOp< T >::type no_op_t
Definition: type_mod.h:48
#define SCL_TYPEMOD(alias)
Definition: type_mod.h:5