std::bind and std::function

Programmers can use this pair of utilities to create and bind functions to variables.

The two functions std::bind and std::functions fit very well together. While std::bind enables you to create new function objects on the fly, std::function takes these temporary function objects and binds them to a variable. Both functions are powerful tools from functional programming and need the header <functional>.

Get hands-on with 1400+ tech skills courses.