I have a std::vector. I want to create iterators representing a slice of that vector. How do I do it? In pseudo C++:
class InterestingType; void doSomethi
use boost range adapters. they are lazy:
operator|() is used to add new behaviour lazily and never modifies its left argument.
boost::for_each(v|sliced(1,5)|transformed(doSomething));
doSomething needs to take range as input. a simple (may be lambda) wrapper would fix that.
doSomething