22 #ifndef GEARS_META_META_HPP
23 #define GEARS_META_META_HPP
25 #include <type_traits>
35 using Type =
typename T::type;
41 template<
typename... Args>
57 template<
typename T, T t>
58 using Const = std::integral_constant<T,t>;
71 using is_deduced = std::is_same<T, deduced>;
102 template<
typename... T>
125 template<
typename Condition,
typename Then,
typename Else>
132 template<
typename Condition,
typename Then,
typename Else>
169 template<
typename... Args>
172 template<
typename T,
typename... Args>
173 struct Any<T, Args...> :
If<T, Bool<true>, Any<Args...>> {};
190 template<
typename... Args>
193 template<
typename T,
typename... Args>
194 struct All<T, Args...> :
If<T, All<Args...>, Bool<false>> {};
196 template<
typename Signature,
typename Anon =
void>
197 struct result_of_impl {};
199 template<
typename Function,
typename... Args>
200 struct result_of_impl<Function(Args...),
Void<decltype(std::declval<Function>()(std::declval<Args>()...))>> {
201 using type = decltype(std::declval<Function>()(std::declval<Args>()...));
208 template<
typename Signature>
239 template<
typename Signature,
typename Class>
262 constexpr T&&
cforward(
typename std::remove_reference<T>::type& t) noexcept {
263 return static_cast<T&&
>(t);
275 constexpr T&&
cforward(
typename std::remove_reference<T>::type&& t) noexcept {
276 static_assert(!std::is_lvalue_reference<T>(),
"error");
277 return static_cast<T&&
>(t);
289 constexpr
typename std::remove_reference<T>::type&&
cmove(T&& t) noexcept {
290 return static_cast<typename std::remove_reference<T>::type&&
>(t);
295 #endif // GEARS_META_META_HPP