Boost logo

Boost Users :

Subject: [Boost-users] [Bind?] Returning generators instead of evaluating.
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2011-10-18 09:11:09


Hi All

Does this functionality exist anywhere in Boost? If so can someone point me
to it, and if not
does it seem like a useful thing?

Thx,

- Rob.

using boost::function;
using boost::bind;

template <typename T, typename T1> function<T( )> function<T( )>
make_generator( function<T(T1)> f, T1 t1 ) { return bind( f, t1 ); }
template <typename T, typename T1, typename T2> function<T( )> function<T(
)> make_generator( function<T(T1, T2)> f, T1 t1, T2 t2 ) { return bind( f,
t1, t2 ); }
template <typename T, typename T1, typename T2, typename T3> function<T( )>
function<T( )> make_generator( function<T(T1, T2, T3)> f, T1 t1, T2 t2, T3
t3 ) { return bind( f, t1, t2, t3 ); }
// ...etc...



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net