I have a Map::const_iterator object in C++ and i am trying to abstract the entire map object from it without explicitly creating a map with Map::const_iterator->first and Map::const_iterator->second.
this doesn’t seem to work : (*Map::const_iterator).as_map()
please advice.
I’m afraid I understood the question totally wrong. How about using it->second?
From the question it is hard to make out what you actually need, but I’m going to guess that you are looking for a way to treat an iterator range as a container, without having to copy the container.
Have a look at Boost Range for that.
You could treat
subrangeas a ‘container’ class with boost range algorithms.Does this come close to what you wanted to ask?
Update
It seems you are after this: