#ifndef _utl_MapKeyIterator_h_ #define _utl_MapKeyIterator_h_ #include namespace utl { template struct ExtractFirst { typedef typename Pair::first_type FirstType; FirstType& operator()(Pair& pair) const { return pair.first; } const FirstType& operator()(const Pair& pair) const { return pair.first; } }; template struct MapKeyIterator : public boost::transform_iterator< ExtractFirst, typename Map::const_iterator, typename ExtractFirst::FirstType& > { typedef ExtractFirst UnaryFunction; typedef typename Map::const_iterator Iterator; typedef typename ExtractFirst::FirstType& Reference; typedef boost::transform_iterator Super; MapKeyIterator(const Iterator& it) : Super(it) { } }; } #endif