diff --git a/BAN/include/BAN/Function.h b/BAN/include/BAN/Function.h index 94e083d7..b2ed0c9a 100644 --- a/BAN/include/BAN/Function.h +++ b/BAN/include/BAN/Function.h @@ -32,7 +32,7 @@ namespace BAN new (m_storage) CallableMemberConst(function, owner); } template - Function(Lambda lambda) + Function(Lambda lambda) requires requires(Lambda lamda, Args... args) { { lambda(args...) } -> BAN::same_as; } { static_assert(sizeof(CallableLambda) <= m_size); new (m_storage) CallableLambda(lambda); diff --git a/BAN/include/BAN/Traits.h b/BAN/include/BAN/Traits.h index 646e5af0..976cf8b3 100644 --- a/BAN/include/BAN/Traits.h +++ b/BAN/include/BAN/Traits.h @@ -42,6 +42,7 @@ namespace BAN template struct is_same : false_type {}; template struct is_same : true_type {}; template inline constexpr bool is_same_v = is_same::value; + template concept same_as = BAN::is_same_v; template struct is_lvalue_reference : false_type {}; template struct is_lvalue_reference : true_type {};