Help with [Boost.Iterator] conditional operator
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
Robert Umland wrote:
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.
Though I might fail to fully understand your question, see: map_values and filtered @ http://p-stade.sourceforge.net/oven/index.html , where you could find the corresponding iterators found in Boost.Iterator.
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.
Such a library(Boost.RangeEx) seems waiting for review. Regards, -- Shunsuke Sogame
participants (2)
-
Robert Umland
-
shunsuke