From d9f632fee7dba5b7b2293e7dfc9df6fc7a42aee3 Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Wed, 18 Jan 2023 18:48:31 -0500 Subject: [PATCH] AK: Move the definition of `IsCallableWithArguments` to `Function.h` It will allow us to use definitions from both `StdLibExtraDetails.h` and `Concepts.h` at the same time. --- AK/Function.h | 11 +++++++++++ AK/StdLibExtraDetails.h | 4 ---- 2 files changed, 11 insertions(+), 4 deletions(-) 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;