Subject: [boost] [General] A standard idiom or technique?
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2008-10-24 04:32:15
A recent post in this list started me thinking...
Given this code snippet,
using namespace std;
void f( int, int );
for ( unsigned i = 0; i <= v1.size( ); ++ i )
f( v1[ i ], v2[ i ] );
How would you write this as a for_each() or in some other Boosty, functional
(The aspect I'm trying to highlight is that two iterators over different
advance in step)
One could imagine a tuple-based solution, in which one specifies how an
applied to the tuple distributes to operations applied to each of the
Does any such thing exist in Boost? Is it ever necessary, or can the
achieved by some C++/STL/Boost idiom that I've not thought of?
If there is no obvious technique, is there any interest in a Boost library
this in a generic way?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk