[Bind] Binding a sequence of operations.

20 May
2011
20 May
'11
1:24 p.m.
Hi All Is it possible to write this code as a for_each/bind combination? I know I could do this with Boost.Lambda or Boost.Phoenix, which is my solution of last resort, but can it be done with plain Boost.Bind? What I think I'm missing is a bindable sequence operator - is there any such thing? Thanks, Rob #include <vector> #include <boost/bind.hpp> #include <boost/range.hpp> struct X { }; void do_this( const X & ); void do_that( const X & ); typedef std::vector<X> Xs; int main( ) { Xs xs; for( Xs::const_iterator x = boost::begin(xs); x != boost::end(xs); ++x ) { do_this( * x ); do_that( * x ); } }
5118
Age (days ago)
5118
Last active (days ago)
0 comments
1 participants
participants (1)
-
Robert Jones