#pragma once #include #ifdef __cplusplus namespace types { template struct constant_value { static constexpr T value = _value; }; using true_type = constant_value; using false_type = constant_value; }; namespace types::traits::inner { template struct remove_pointer { using type = Tp; }; template struct remove_pointer { using type = T; }; template struct remove_reference { using type = Tr; }; template struct remove_reference { using type = T; }; } // namespace types::traits::inner namespace types::traits { template struct remove_pointer : inner::remove_pointer { }; template struct remove_reference : inner::remove_reference { }; template struct add_pointer { using type = T*; }; template struct add_reference { using type = T&; }; template struct remove_cv { using type = T; }; template struct remove_cv { using type = T; }; template struct remove_cv { using type = T; }; template struct remove_cv { using type = T; }; template struct is_pointer : false_type { }; template struct is_pointer : true_type { }; template struct decay { private: using U = remove_reference; public: using type = typename remove_cv::type; }; } // namespace types::traits namespace types { template T&& move(T& val) { return static_cast(val); } template T&& forward(typename traits::remove_reference::type& val) { return static_cast(val); } template struct template_true_type : public true_type { }; template struct template_false_type : public false_type { }; template struct is_same : false_type { }; template struct is_same : true_type { }; template struct add_rvalue_reference { using type = T&&; }; template <> struct add_rvalue_reference { using type = void; }; template concept convertible_to = (traits::is_pointer::value && is_same::value) || (traits::is_pointer::value && is_same::value) || requires(Src _src) { { static_cast(_src) }; }; template concept PointerType = traits::is_pointer::value; template concept same_as = is_same::value; } // namespace types #endif