Effective STL (Gal Zentner's Library) by Scott Meyers

Effective STL (Gal Zentner's Library) by Scott Meyers

Author:Scott Meyers
Language: eng
Format: epub
Publisher: Addison-Wesley Professional
Published: 2008-03-08T16:00:00+00:00


If we want to erase the element pointed to by ri, we can’t just use i, because i doesn’t point to the same element as ri. Instead, we must erase the element preceding i. Hence,

• To emulate erasure at a position specified by a reverse_iterator ri, erase at the position preceding ri.base() instead. For purposes of erasure, ri and ri.base() are not equivalent, and ri.base() is not the iterator corresponding to ri.

It’s worth looking at the code to perform such an erasure, because it holds a surprise.

vector<int> v;



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.