Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Function template bind



// In header: <boost/compute/functional/bind.hpp>

template<typename F, class... Args> unspecified bind(F f, Args... args);


Returns a function wrapper which invokes f with args when called.

For example, to generate a unary function object which returns true when its argument is less than 7:

using boost::compute::less;
using boost::compute::placeholders::_1;

auto less_than_seven = boost::compute::bind(less<int>(), _1, 7);