Header Reference: <functional>
Header Reference: <functional>
Call wrappers, invocation utilities, binders, hashing, and function-object helpers from <functional>.
Header Reference: <functional>
Call wrappers, invocation utilities, binders, hashing, and function-object helpers from <functional>.
Use reference pages to confirm names, categories, nearby facilities, and the constraints that matter before writing or reviewing code.
Header reference pages are meant to answer a practical question quickly: what this header provides, when to reach for it, and which usage rules are easiest to get wrong.
<functional>std::functionstd::move_only_functionstd::copyable_functionstd::bindstd::bind_frontstd::not_fnstd::invokestd::invoke_rstd::reference_wrapperstd::ref, std::crefstd::mem_fnstd::hashUse <functional> for generic callable handling, invocation, adapting member functions, and hashing support for standard containers.
std::functionstd::invokestd::refauto parameters over std::function in hot paths when type erasure is not needed.std::bind still exists, but lambdas are usually clearer.#include <functional>
int main() {
// Start with the primary facility from <functional>.
// Then verify lifetime, invalidation, ordering, or error-handling rules.
return 0;
}