Phi
remove_cv.hpp
1 #ifndef INCG_PHI_CORE_TYPE_TRAITS_REMOVE_CV_HPP
2 #define INCG_PHI_CORE_TYPE_TRAITS_REMOVE_CV_HPP
3 
4 #include "phi/phi_config.hpp"
5 
6 #if PHI_HAS_EXTENSION_PRAGMA_ONCE()
7 # pragma once
8 #endif
9 
10 #include "phi/compiler_support/intrinsics/remove_cv.hpp"
11 
12 DETAIL_PHI_BEGIN_NAMESPACE()
13 
14 #if PHI_SUPPORTS_REMOVE_CV()
15 
16 template <typename TypeT>
17 struct remove_cv
18 {
19  using type = PHI_REMOVE_CV(TypeT);
20 };
21 
22 template <typename TypeT>
23 using remove_cv_t = PHI_REMOVE_CV(TypeT);
24 
25 #else
26 
27 template <typename TypeT>
28 struct remove_cv
29 {
30  using type = TypeT;
31 };
32 
33 template <typename TypeT>
34 struct remove_cv<const TypeT>
35 {
36  using type = TypeT;
37 };
38 
39 template <typename TypeT>
40 struct remove_cv<volatile TypeT>
41 {
42  using type = TypeT;
43 };
44 
45 template <typename TypeT>
46 struct remove_cv<const volatile TypeT>
47 {
48  using type = TypeT;
49 };
50 
51 template <typename TypeT>
52 using remove_cv_t = typename remove_cv<TypeT>::type;
53 
54 #endif
55 
56 DETAIL_PHI_END_NAMESPACE()
57 
58 #endif // INCG_PHI_CORE_TYPE_TRAITS_REMOVE_CV_HPP
Definition: remove_cv.hpp:28