From 19ce24de5e8ef31be2925074e962ae23aaf65be0 Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Fri, 23 Aug 2024 20:05:22 +0200 Subject: Some work on ptr --- asl/meta.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'asl/meta.hpp') diff --git a/asl/meta.hpp b/asl/meta.hpp index b3e0697..411d890 100644 --- a/asl/meta.hpp +++ b/asl/meta.hpp @@ -2,6 +2,10 @@ namespace asl { +template struct types {}; + +struct empty {}; + template struct id { using type = T; }; template struct integral_constant { static constexpr T value = kValue; }; @@ -29,6 +33,12 @@ template auto _as_rref_helper(...) -> id; template using as_lref_t = decltype(_as_lref_helper(0))::type; template using as_rref_t = decltype(_as_rref_helper(0))::type; +template struct _un_ref_t { using type = T; }; +template struct _un_ref_t { using type = T; }; +template struct _un_ref_t { using type = T; }; + +template using un_ref_t = _un_ref_t::type; + template concept constructible = __is_constructible(T, Args...); template concept default_constructible = constructible; @@ -123,4 +133,13 @@ template struct _is_array_helper : true_type {}; template concept is_array = _is_array_helper::value; +template +auto _devoid_helper() +{ + if constexpr (is_void) return id{}; + else return id{}; +} + +template using devoid_t = decltype(_devoid_helper())::type; + } // namespace asl -- cgit