1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 05:27:45 +00:00

AK: Add a CallableAs<R, Args...> concept

This is just the concept version of the IsCallableWithArguments type
trait previously defined in Function.h.
This commit is contained in:
Ali Mohammad Pur 2023-07-08 14:08:25 +03:30 committed by Linus Groh
parent 35599605c1
commit 5a0ad6812c
2 changed files with 28 additions and 17 deletions

View file

@ -36,23 +36,6 @@
namespace AK {
namespace Detail {
template<typename T, typename Out, typename... Args>
inline constexpr bool IsCallableWithArguments = requires(T t) {
{
t(declval<Args>()...)
} -> ConvertibleTo<Out>;
} || requires(T t) {
{
t(declval<Args>()...)
} -> SameAs<Out>;
};
}
using Detail::IsCallableWithArguments;
template<typename>
class Function;