19 using type = std::remove_cv_t<std::remove_reference_t<T>>;
24 using remove_cvref_t =
typename remove_cvref<T>::type;
35 struct UnderlyingType<const T>
37 using type =
typename UnderlyingType<T>::type;
41 struct UnderlyingType<T&>
43 using type =
typename UnderlyingType<T>::type;
47 struct UnderlyingType<T*>
49 using type =
typename UnderlyingType<T>::type;
53 struct UnderlyingType<std::reference_wrapper<T>>
55 using type =
typename UnderlyingType<T>::type;
59 struct UnderlyingType<std::shared_ptr<T>>
61 using type =
typename UnderlyingType<T>::type;
65 struct UnderlyingType<std::unique_ptr<T>>
67 using type =
typename UnderlyingType<T>::type;
72 using Underlying_t =
typename Impl::UnderlyingType<T>::type;
77 T& underlying(T& value)
84 T& underlying(T* value)
91 T underlying(T&& value) =
delete;
95 T& underlying(std::reference_wrapper<T>
const& value)
102 T& underlying(std::shared_ptr<T>
const& value)
109 T& underlying(std::unique_ptr<T>
const& value)
116 #define FWD(...) static_cast<decltype(__VA_ARGS__)>(__VA_ARGS__) 119 #define TYPEOF(...) AMDiS::remove_cvref_t<decltype(__VA_ARGS__)> 122 #define VALUE(...) TYPEOF(__VA_ARGS__)::value 127 template <
class... Ts>
130 template <
class... Ts>
141 template <
class... T>
142 constexpr
void operator()(T&&...)
const { }
147 auto makeUniquePtr(Obj&& obj)
149 return std::make_unique<TYPEOF(obj)>(FWD(obj));
153 auto makeSharedPtr(Obj&& obj)
155 return std::make_shared<TYPEOF(obj)>(FWD(obj));
159 using enable_if_all_t = std::enable_if_t<(b &&...)>;
A functor with no operation.
Definition: TypeTraits.hpp:139
A variadic type list.
Definition: TypeTraits.hpp:128
Definition: AdaptBase.hpp:6
Remove cv and ref qualifiers of type T.
Definition: TypeTraits.hpp:17