MPL11
 All Classes Namespaces Files Typedefs Macros Groups Pages
List of all members
boost::mpl11::bind< f, fs > Struct Template Reference

Invokes f with the result of invoking each fs... with the arguments. More...

#include <boost/mpl11/fwd/functional.hpp>

Detailed Description

template<typename f, typename... fs>
struct boost::mpl11::bind< f, fs >

Invokes f with the result of invoking each fs... with the arguments.

Specifically, apply<bind<f, fs...>, x...> is equivalent to apply<f, apply<fs, x...>...>. The arity of f must match the number of fs....

Note
When used with two metafunction classes only, bind has the property of being associative, i.e. bind<f, bind<g, h>> is equivalent to bind<bind<f, g>, h>.

Haskell pseudo-code:

-- definition
bind f fs... $ xs... == f (fs xs...)...
-- proof of associativity (in the binary case)
bind f (bind g h) $ xs... == f ((bind g h) xs...)
== f (g (h xs...))
bind (bind f g) h $ xs... == (bind f g) (h xs...)
== f (g (h xs...))