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.
This commit is contained in:
parent
e538fa203e
commit
d9f632fee7
Notes:
sideshowbarker
2024-07-18 03:35:30 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/d9f632fee7 Pull-request: https://github.com/SerenityOS/serenity/pull/17090 Reviewed-by: https://github.com/ADKaster ✅
2 changed files with 11 additions and 4 deletions
|
@ -36,6 +36,16 @@
|
||||||
|
|
||||||
namespace AK {
|
namespace AK {
|
||||||
|
|
||||||
|
namespace Detail {
|
||||||
|
|
||||||
|
template<typename T, typename... Args>
|
||||||
|
inline constexpr bool IsCallableWithArguments = requires(T t) {
|
||||||
|
t(declval<Args>()...);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
using Detail::IsCallableWithArguments;
|
||||||
|
|
||||||
template<typename>
|
template<typename>
|
||||||
class Function;
|
class Function;
|
||||||
|
|
||||||
|
@ -271,4 +281,5 @@ private:
|
||||||
|
|
||||||
#if USING_AK_GLOBALLY
|
#if USING_AK_GLOBALLY
|
||||||
using AK::Function;
|
using AK::Function;
|
||||||
|
using AK::IsCallableWithArguments;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -522,9 +522,6 @@ inline constexpr bool IsTrivial = __is_trivial(T);
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline constexpr bool IsTriviallyCopyable = __is_trivially_copyable(T);
|
inline constexpr bool IsTriviallyCopyable = __is_trivially_copyable(T);
|
||||||
|
|
||||||
template<typename T, typename... Args>
|
|
||||||
inline constexpr bool IsCallableWithArguments = requires(T t) { t(declval<Args>()...); };
|
|
||||||
|
|
||||||
template<typename T, typename... Args>
|
template<typename T, typename... Args>
|
||||||
inline constexpr bool IsConstructible = requires { ::new T(declval<Args>()...); };
|
inline constexpr bool IsConstructible = requires { ::new T(declval<Args>()...); };
|
||||||
|
|
||||||
|
@ -635,7 +632,6 @@ using AK::Detail::IntegerSequence;
|
||||||
using AK::Detail::IsArithmetic;
|
using AK::Detail::IsArithmetic;
|
||||||
using AK::Detail::IsAssignable;
|
using AK::Detail::IsAssignable;
|
||||||
using AK::Detail::IsBaseOf;
|
using AK::Detail::IsBaseOf;
|
||||||
using AK::Detail::IsCallableWithArguments;
|
|
||||||
using AK::Detail::IsClass;
|
using AK::Detail::IsClass;
|
||||||
using AK::Detail::IsConst;
|
using AK::Detail::IsConst;
|
||||||
using AK::Detail::IsConstructible;
|
using AK::Detail::IsConstructible;
|
||||||
|
|
Loading…
Add table
Reference in a new issue