From 6726a96f0cf3c230e9caa2abd40fcfbf03fe73a4 Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Sun, 3 Nov 2024 19:08:01 +0100 Subject: A bunch of cleanup --- asl/meta.hpp | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'asl/meta.hpp') diff --git a/asl/meta.hpp b/asl/meta.hpp index 2085118..1d82739 100644 --- a/asl/meta.hpp +++ b/asl/meta.hpp @@ -24,7 +24,7 @@ template using select_t = _select_helper struct _is_same_helper : false_type {}; template struct _is_same_helper : true_type {}; -template concept is_same = _is_same_helper::value && _is_same_helper::value; +template concept same_as = _is_same_helper::value && _is_same_helper::value; template auto _as_lref_helper(int) -> id; template auto _as_lref_helper(...) -> id; @@ -43,38 +43,37 @@ 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 constructible_from = __is_constructible(T, Args...); -template concept default_constructible = constructible; -template concept copy_constructible = constructible>; -template concept move_constructible = constructible>; +template concept default_constructible = constructible_from; +template concept copy_constructible = constructible_from>; +template concept move_constructible = constructible_from>; -template concept trivially_constructible = __is_trivially_constructible(T, Args...); +template concept trivially_constructible_from = __is_trivially_constructible(T, Args...); -template concept trivially_default_constructible = trivially_constructible; -template concept trivially_copy_constructible = trivially_constructible>; -template concept trivially_move_constructible = trivially_constructible>; +template concept trivially_default_constructible = trivially_constructible_from; +template concept trivially_copy_constructible = trivially_constructible_from>; +template concept trivially_move_constructible = trivially_constructible_from>; -template concept assignable = __is_assignable(T, Args...); +template concept assignable_from = __is_assignable(T, Args...); -template concept copy_assignable = assignable, as_lref_t>; -template concept move_assignable = assignable, as_rref_t>; +template concept copy_assignable = assignable_from, as_lref_t>; +template concept move_assignable = assignable_from, as_rref_t>; -template concept trivially_assignable = __is_trivially_assignable(T, Args...); +template concept trivially_assignable_from = __is_trivially_assignable(T, Args...); -template concept trivially_copy_assignable = trivially_assignable, as_lref_t>; -template concept trivially_move_assignable = trivially_assignable, as_rref_t>; +template concept trivially_copy_assignable = trivially_assignable_from, as_lref_t>; +template concept trivially_move_assignable = trivially_assignable_from, as_rref_t>; template concept trivially_destructible = __is_trivially_destructible(T); template concept trivially_copyable = __is_trivially_copyable(T); -// @Todo Rename concepts (_from) -template -concept convertible = __is_convertible(From, To); +template +concept convertible_from = __is_convertible(From, To); template -concept derived_from = __is_class(Derived) && __is_class(Base) && convertible; +concept derived_from = __is_class(Derived) && __is_class(Base) && convertible_from; using nullptr_t = decltype(nullptr); @@ -92,7 +91,7 @@ template using un_cv_t = un_volatile_t>; template using un_cvref_t = un_ref_t>; -template concept is_void = is_same>; +template concept is_void = same_as>; template struct _is_ref_helper { static constexpr bool l = false; static constexpr bool r = false; }; template struct _is_ref_helper { static constexpr bool l = true; static constexpr bool r = false; }; -- cgit