C++Spec 1.0.0
BDD testing for C++
Loading...
Searching...
No Matches
CppSpec::Util::is_functional Concept Reference

Concept definition

template<typename C>
concept is_functional =
// The C++ reference says that all "functions" (not FunctionObjects) respond to
// std::is_function<T>
std::is_function_v<C> ||
// An alternative from Stack Overflow question 18107368. Anything that could
// possibly be "functional" should be able to be cast to std::function<void()>
std::is_convertible_v<C, std::function<void()>> ||
// The C++ reference also says that something qualifies as a FunctionObject iff
// std::is_object_v<T> is true and the object responds to the call operator()
requires(C func) {
requires std::is_object_v<C>;
{ func() } -> std::invocable<>;
}
Definition util.hpp:86