Files
2025-10-25 03:02:53 +03:00

1.4 KiB
Raw Permalink Blame History

[concept.invocable]

18 Concepts library [concepts]

18.7 Callable concepts [concepts.callable]

18.7.2 Concept invocable [concept.invocable]

1

#

The invocable concept specifies a relationship between a callable type ([func.def]) F and a set of argument types Args... which can be evaluated by the library function invoke ([func.invoke]).

🔗

template<class F, class... Args> concept [invocable](#concept:invocable "18.7.2Concept invocable[concept.invocable]") = requires(F&& f, Args&&... args) { invoke(std::forward<F>(f), std::forward<Args>(args)...); // not required to be equality-preserving };

2

#

[Example 1:

A function that generates random numbers can model invocable, since the invoke function call expression is not required to be equality-preserving ([concepts.equality]).

— end example]