|
- #pragma once
-
- #include <cstddef>
-
- #define cppmp_define_modifier(name) \
- template<typename... T> \
- struct name \
- : public std::name<T...> \
- { }; \
- \
- template<typename... T> \
- using name ## _t = typename name<T...>::type
-
- namespace cppmp
- {
-
- template<class T>
- struct decay;
-
- template<typename T>
- using decay_t = typename decay<T>::type;
-
- /* const-volatile modifications */
-
- #ifdef cppmp_std_supports_remove_const
- cppmp_define_modifier(remove_const);
- #endif
-
- #ifdef cppmp_std_supports_remove_volatile
- cppmp_define_modifier(remove_volatile);
- #endif
-
- #ifdef cppmp_std_supports_remove_cv
- cppmp_define_modifier(remove_cv);
- #endif
-
- #ifdef cppmp_std_supports_add_const
- cppmp_define_modifier(add_const);
- #endif
-
- #ifdef cppmp_std_supports_add_volatile
- cppmp_define_modifier(add_volatile);
- #endif
-
- #ifdef cppmp_std_supports_add_cv
- cppmp_define_modifier(add_cv);
- #endif
-
- /* reference modifications */
-
- #ifdef cppmp_std_supports_remove_reference
- cppmp_define_modifier(remove_reference);
- #endif
-
- #ifdef cppmp_std_supports_add_lvalue_reference
- cppmp_define_modifier(add_lvalue_reference);
- #endif
-
- #ifdef cppmp_std_supports_add_rvalue_reference
- cppmp_define_modifier(add_rvalue_reference);
- #endif
-
- /* sign modifications */
-
- #ifdef cppmp_std_supports_make_signed
- cppmp_define_modifier(make_signed);
- #endif
-
- #ifdef cppmp_std_supports_make_unsigned
- cppmp_define_modifier(make_unsigned);
- #endif
-
- /* array modifications */
-
- #ifdef cppmp_std_supports_remove_extent
- cppmp_define_modifier(remove_extent);
- #endif
-
- #ifdef cppmp_std_supports_remove_all_extents
- cppmp_define_modifier(remove_all_extents);
- #endif
-
- /* pointer modifications */
-
- #ifdef cppmp_std_supports_add_pointer
- cppmp_define_modifier(add_pointer);
- #endif
-
- #ifdef cppmp_std_supports_remove_pointer
- cppmp_define_modifier(remove_pointer);
- #endif
-
- /* other transformations */
-
- #ifdef cppmp_std_supports_remove_cvref
- cppmp_define_modifier(remove_cvref);
- #endif
-
- #ifdef cppmp_std_supports_common_type
- cppmp_define_modifier(common_type);
- #endif
-
- #ifdef cppmp_std_supports_underlying_type
- cppmp_define_modifier(underlying_type);
- #endif
-
- #ifdef cppmp_std_supports_result_of
- cppmp_define_modifier(result_of);
- #endif
-
- #ifdef cppmp_std_supports_invoke_result
- cppmp_define_modifier(invoke_result);
- #endif
-
- #ifdef cppmp_std_supports_aligned_storage
- template <std::size_t Len, std::size_t Align>
- struct aligned_storage
- : public std::aligned_storage<Len, Align>
- { };
-
- template <std::size_t Len, std::size_t Align>
- using aligned_storage_t = typename aligned_storage<Len, Align>::type;
- #endif
-
- #ifdef cppmp_std_supports_aligned_union
- template <std::size_t Len, class... Types>
- struct aligned_union
- : public std::aligned_union<Len, Types...>
- { };
-
- template <std::size_t Len, class... Types>
- using aligned_union_t = typename aligned_union<Len, Types...>::type;
- #endif
-
- }
-
- #undef cppmp_define_modifier
-
- #include "modifier.inl"
|