Callable Objects

suggest change

Introduction

A callable is anything std::invoke can call. Examples include functions, function pointers, pointers to members, lambdas, and objects whose classes overload operator(). A pointer to a member is not invoked with ordinary function-call syntax; use .*, ->*, or std::invoke (since C++17). Most of these can be stored in std::function when their signatures are compatible. Standard-library algorithms commonly accept callables as predicates, projections, or operations.

Remarks

A very useful talk by Stephan T. Lavavej (<functional>: What’s New, And Proper Use) (Slides) leads to the base of this documentation.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents