beautiful russian girls for dating - Invalidating list iterator

That is the purpose of a map: access to storage of mutable data via some form of unique key.Lastly, maps are unique among all STL associative containers in that they do implement the [] operator. Oops, I knew I'd get flamed for my response because I realized last night while I was caulking my bathroom sink that you were trying to swap associated values, not keys, in which case the original problem could be solved using std::advance().

I want to swap random elements of a map, but I don't seem to be able to access a map other than by key.

It doesn't matter which elements are swapped, as long as there are random elements swapped.

So how should I swap 2 random elements of a map instead?

(without knowing the key in advance) BTW: I already presumed my code isn't the right way to do it, I was just hoping to find a correct way here. The whole purpose of a map is to associate a key and value(s).

Question 1: You can insert items into a map and remove them without invalidating iterators.

This is not a true statement for all containers, however.

= My Container.end(); ) Is there a way to call erase(iter) on a list without invalidating theiterator?

Can I make a copy of an iterator and then move forward theoriginal without moving the copy?

Is there a way to call erase(iter) on a list without invalidating the iterator?

Can I make a copy of an iterator and then move forward the original without moving the copy?

Here is my try: Compiler: Default compiler Bezig met uitvoeren van g ..

Tags: , ,