Boost logo

Boost Users :

Subject: [Boost-users] Using single-pass ranges.
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2012-07-24 06:04:15


I have a class that hands out a sequence of Things through a
getNextThing() interface, ie.,

struct Thing { };

struct ThingFeed
{
    Thing * getNextThing( );
};

returning null when there's no more things. I'd like to be
able to feed this into the Boost range-based algorithms, something
like

boost::for_each( thingFeedProxy | filter( someCondition ), doSomething );

But it's not clear to me how or if I can represent my ThingFeed as a range.
Any thoughts or advice appreciated.

Thx, Rob



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