diff --git a/AK/Function.h b/AK/Function.h index f202429fa6a..5c9f690c915 100644 --- a/AK/Function.h +++ b/AK/Function.h @@ -36,6 +36,16 @@ namespace AK { +namespace Detail { + +template +inline constexpr bool IsCallableWithArguments = requires(T t) { + t(declval()...); + }; +} + +using Detail::IsCallableWithArguments; + template class Function; @@ -271,4 +281,5 @@ private: #if USING_AK_GLOBALLY using AK::Function; +using AK::IsCallableWithArguments; #endif diff --git a/AK/StdLibExtraDetails.h b/AK/StdLibExtraDetails.h index b2a0bcf77af..1fef15c4bb0 100644 --- a/AK/StdLibExtraDetails.h +++ b/AK/StdLibExtraDetails.h @@ -522,9 +522,6 @@ inline constexpr bool IsTrivial = __is_trivial(T); template inline constexpr bool IsTriviallyCopyable = __is_trivially_copyable(T); -template -inline constexpr bool IsCallableWithArguments = requires(T t) { t(declval()...); }; - template inline constexpr bool IsConstructible = requires { ::new T(declval()...); }; @@ -635,7 +632,6 @@ using AK::Detail::IntegerSequence; using AK::Detail::IsArithmetic; using AK::Detail::IsAssignable; using AK::Detail::IsBaseOf; -using AK::Detail::IsCallableWithArguments; using AK::Detail::IsClass; using AK::Detail::IsConst; using AK::Detail::IsConstructible;