Summary
This episode explores std::bind, a utility introduced in C++11 (originally from Boost) that creates function objects by binding arguments to callable targets. Jason demonstrates how std::bind can create partial function applications, reorder arguments, and create adaptors for existing functions. He highlights important details about std::bind, including how it copies arguments by default, its inability to work directly with template functions, its compile-time overhead, and how its results can be stored in std::function objects for type erasure.
Related C++ Standard Sections
This episode covers topics found in these sections of the C++ standard:
-
[func.bind]40% match -
[func.bind.bind]40% match -
[function.objects]40% match -
[ostream.manip]40% match