|
- #pragma once
-
- #include <cstddef>
- #include <type_traits>
-
- #include <cppmp/config.h>
-
- namespace cppmp
- {
-
- /**
- * @brief Evaluates to void.
- */
- template<typename...>
- using void_t = void;
-
- /**
- * @brief Store a single type.
- */
- template<typename X>
- struct type_t
- { };
-
- #ifdef cppmp_supports_variable_templates
- template<typename X>
- constexpr decltype(auto) type_v = type_t<X> { };
- #endif
-
- /**
- * @brief Simple type list.
- */
- template<typename...>
- struct list
- { };
-
- /**
- * @brief Inherit from all passed types.
- */
- template<typename... T>
- struct inherit
- : public T...
- { };
-
- /**
- * @brief Type to wrap constant values at compile time.
- */
- template<typename T, T t>
- struct integral_constant
- : public std::integral_constant<T, t>
- { };
-
- /**
- * @brief Boolean constant type.
- */
- template<bool B>
- struct bool_t
- : public integral_constant<bool, B>
- { };
-
- /**
- * @brief True boolean constant type.
- */
- struct true_t
- : public bool_t<true>
- { };
-
- /**
- * @brief False boolean constant type.
- */
- struct false_t
- : public bool_t<false>
- { };
-
- /**
- * @brief Size contant type.
- */
- template<size_t S>
- struct size_t
- : public integral_constant<std::size_t, S>
- { };
-
- /**
- * @brief Zero zize constant type.
- */
- struct zero_t
- : public size_t<0>
- { };
-
- }
|