diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-11-02 19:54:50 +0100 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-12-20 15:35:58 +0100 |
commit | c09323804c6c6d42c052b1c60061134261e515fc (patch) | |
tree | 1c5dd6962e82ee35bc1ae662e6f268826511ada9 /asl/meta.hpp | |
parent | be34f768e093cb6752ab81fde3ab529861a8a6a8 (diff) |
Add function with invoke and result_of_t
Diffstat (limited to 'asl/meta.hpp')
-rw-r--r-- | asl/meta.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/asl/meta.hpp b/asl/meta.hpp index d253dda..2085118 100644 --- a/asl/meta.hpp +++ b/asl/meta.hpp @@ -35,6 +35,8 @@ template<typename T> auto _as_rref_helper(...) -> id<T>; template<typename T> using as_lref_t = decltype(_as_lref_helper<T>(0))::type;
template<typename T> using as_rref_t = decltype(_as_rref_helper<T>(0))::type;
+template<typename T> consteval as_rref_t<T> declval() {}
+
template<typename T> struct _un_ref_t { using type = T; };
template<typename T> struct _un_ref_t<T&> { using type = T; };
template<typename T> struct _un_ref_t<T&&> { using type = T; };
@@ -67,9 +69,13 @@ template<typename T> concept trivially_destructible = __is_trivially_destructibl template<typename T> concept trivially_copyable = __is_trivially_copyable(T);
+// @Todo Rename concepts (_from)
template<typename From, typename To>
concept convertible = __is_convertible(From, To);
+template<typename Derived, class Base>
+concept derived_from = __is_class(Derived) && __is_class(Base) && convertible<const volatile Derived*, const volatile Base*>;
+
using nullptr_t = decltype(nullptr);
template<typename T> struct _un_const_helper { using type = T; };
|