|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||
Defined in header <concepts> | ||
template<class F,class...Args> concept invocable= | (since C++20) | |
template<class F,class...Args> concept regular_invocable= std::invocable<F, Args...>; | (since C++20) | |
Theinvocable concept specifies that a callable typeF can be called with a set of argumentsArgs... using the function templatestd::invoke.
Theregular_invocable concept adds to theinvocable concept by requiring theinvoke expression to beequality-preserving and not modify either the function object or the arguments.
Contents |
Expressions declared inrequires expressions of the standard library concepts are required to beequality-preserving (except where stated otherwise).
The distinction betweeninvocable andregular_invocable is purely semantic.
A random number generator may satisfyinvocable but cannot satisfyregular_invocable (comical ones excluded).
invocable [concept.invocable] regular_invocable [concept.regularinvocable] invocable [concept.invocable] regular_invocable [concept.regularinvocable] | checks if a type can be invoked (as if bystd::invoke) with the given argument types (class template)[edit] |
Ajoke example of a random number generator that satisfies bothinvocable andregular_invocable. |