My Project
decay.hpp
Go to the documentation of this file.
1 
28 #ifndef BSL_DECAY_HPP
29 #define BSL_DECAY_HPP
30 
31 #include "add_pointer.hpp"
32 #include "is_array.hpp"
33 #include "is_function.hpp"
34 #include "remove_cv.hpp"
35 #include "remove_extent.hpp"
36 #include "remove_reference.hpp"
37 
38 namespace bsl
39 {
52  template<
53  typename T,
54  bool IS_ARRAY = is_array<remove_reference_t<T>>::value,
55  bool IS_FUNCTION = is_function<remove_reference_t<T>>::value>
56  struct decay final
57  {
60  };
61 
63  template<typename T>
64  using decay_t = typename decay<T>::type;
65 
67 
68  template<typename T>
69  struct decay<T, true, true> final
70  {
73  };
74 
75  template<typename T>
76  struct decay<T, true, false> final
77  {
79  using type = remove_extent_t<remove_reference_t<T>> *;
80  };
81 
82  template<typename T>
83  struct decay<T, false, true> final
84  {
86  using type = add_pointer_t<remove_reference_t<T>>;
87  };
88 
90 }
91 
92 #endif
typename decay< T >::type decay_t
a helper that reduces the verbosity of bsl::decay
Definition: decay.hpp:64
Applies lvalue-to-rvalue, array-to-pointer, and function-to-pointer implicit conversions to the type ...
Definition: decay.hpp:56
typename remove_cv< T >::type remove_cv_t
a helper that reduces the verbosity of bsl::remove_cv
Definition: remove_cv.hpp:66
remove_cv_t< remove_reference_t< T > > type
provides the member typedef "type"
Definition: decay.hpp:59
typename remove_extent< T >::type remove_extent_t
a helper that reduces the verbosity of bsl::remove_extent
Definition: remove_extent.hpp:54