22 Sep
2012
22 Sep
'12
3:42 a.m.
hello it would be great to be pass
transform_iterator( my_iterator, []( reference ) { return /// something } );
directly to STL algorithms.
Currently, one needs to define separately the unarfy function as far as i could see
You can use the 'regular' function from Akira Takahashi's extensions to the Boost.Range library [1] like so: make_transform_iterator(my_iterator, regular([]( ... ) { ... })); If you are using the 'transformed' range adaptor instead of using transform_iterator directly, it's even nicer: you just use '|+' to pipe the adaptor instead of '|'. That is, R | transformed([](...){...}) becomes R |+ transformed([](...){...}) Regards, Nate [1] http://dl.dropbox.com/u/1682460/git/OvenToBoost/libs/range/doc/html/range_ex...