diff -r 39b6e65574c6 -r 0759d974de81 lemon/maps.h --- a/lemon/maps.h Thu Apr 02 22:34:03 2015 +0200 +++ b/lemon/maps.h Sun Jan 05 22:24:56 2014 +0100 @@ -25,6 +25,7 @@ #include #include +#include ///\file ///\ingroup maps @@ -2581,6 +2582,16 @@ const IterableBoolMap* _map; }; + /// \brief STL style iterator for the keys mapped to \c true. + /// + /// This is an STL style wrapper for \ref TrueIt. + /// It can be used in range-based for loops, STL algorithms, etc. + LemonRangeWrapper1 + trueKeys() { + return LemonRangeWrapper1(*this); + } + + /// \brief Iterator for the keys mapped to \c false. /// /// Iterator for the keys mapped to \c false. It works @@ -2620,6 +2631,16 @@ const IterableBoolMap* _map; }; + /// \brief STL style iterator for the keys mapped to \c false. + /// + /// This is an STL style wrapper for \ref FalseIt. + /// It can be used in range-based for loops, STL algorithms, etc. + LemonRangeWrapper1 + falseKeys() { + return LemonRangeWrapper1(*this); + } + + /// \brief Iterator for the keys mapped to a given value. /// /// Iterator for the keys mapped to a given value. It works @@ -2664,6 +2685,15 @@ const IterableBoolMap* _map; }; + /// \brief STL style iterator for the keys mapped to a given value. + /// + /// This is an STL style wrapper for \ref ItemIt. + /// It can be used in range-based for loops, STL algorithms, etc. + LemonRangeWrapper2 + items(bool value) { + return LemonRangeWrapper2(*this, value); + } + protected: virtual void add(const Key& key) { @@ -3005,6 +3035,16 @@ const IterableIntMap* _map; }; + /// \brief STL style iterator for the keys with the same value. + /// + /// This is an STL style wrapper for \ref ItemIt. + /// It can be used in range-based for loops, STL algorithms, etc. + LemonRangeWrapper2 + items(int value) { + return LemonRangeWrapper2(*this, value); + } + + protected: virtual void erase(const Key& key) { @@ -3248,6 +3288,16 @@ const IterableValueMap* _map; }; + /// \brief STL style iterator for the keys with the same value. + /// + /// This is an STL style wrapper for \ref ItemIt. + /// It can be used in range-based for loops, STL algorithms, etc. + LemonRangeWrapper2 + items(const V& value) { + return LemonRangeWrapper2(*this, value); + } + + protected: virtual void add(const Key& key) {