Boost logo

Boost Users :

From: Robert Umland (robert.umland_at_[hidden])
Date: 2008-03-07 16:03:14


I just recently started using boost and had a question about the
++operator for iterators.

What I have is a class foo that has a container of class bar.

class foo
{
private:
    multimap<bool, bar> container;
public:
    pair<bar::iterator, bar::iterator> get_container( bool usable );
};

class bar
{
public:
    /*
     * Return true if bar is usable, false otherwise.
     */
    bool isUsable();
};

I would like to overload the ++operator for multimap so that I can
return all bar's that are usable, i.e. call the bar::isUsable()
function before returning the pair of iterators.

I did find this web page:
http://www.zeta.org.au/~jon/STL/views/doc/views.html
and was wondering if boost had anything like this already.

Thanks.

-- 
~Robert Umland

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