Click here to Skip to main content
16,005,339 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: reading a text document (I hope this is the right place :) ) Pin
John M. Drescher15-May-03 6:43
John M. Drescher15-May-03 6:43 
GeneralRe: reading a text document (I hope this is the right place :) ) Pin
jhaga15-May-03 7:41
professionaljhaga15-May-03 7:41 
GeneralMainFrame :o) Pin
MemLeak15-May-03 6:00
MemLeak15-May-03 6:00 
GeneralRe: MainFrame :o) Pin
David Crow15-May-03 6:37
David Crow15-May-03 6:37 
GeneralRe: MainFrame :o) Pin
peterchen15-May-03 20:35
peterchen15-May-03 20:35 
GeneralRe: MainFrame :o) Pin
David Crow16-May-03 3:40
David Crow16-May-03 3:40 
GeneralRe: MainFrame :o) Pin
peterchen16-May-03 3:49
peterchen16-May-03 3:49 
GeneralSTL: reference to map items Pin
peterchen15-May-03 5:51
peterchen15-May-03 5:51 
Hi,
is it guaranteed in an STL map that references to an pair<const key,="" value=""> remain valid even if new items are inserted, or other items are removed?
i.e.
tMyMap::iterator it = map.find( ... );
tMyMap::value_type & pPair = *it;
map.insert( ... );
map.erase( some other element );
// here: pPair still valid?

Background:
I need a map<string, somestruct> for lookups, but also need to be able to iterate in the original insertion order. (deletes ar rare, they can be O(nn) and I wouldn't care).

I thought keeping the map around as usual, and having a separate list<tmyMap::value_type *> heeping references to the map items in original insertion order would give me fast lookup as desired.

TIA
Peter


"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS

sighist | Agile Programming | doxygen

GeneralRe: STL: reference to map items Pin
Joseph Dempsey15-May-03 7:55
Joseph Dempsey15-May-03 7:55 
GeneralRe: STL: reference to map items Pin
jbarton15-May-03 8:57
jbarton15-May-03 8:57 
Generalthanks! Pin
peterchen15-May-03 20:33
peterchen15-May-03 20:33 
General.Net and "edit and continue" Pin
ns15-May-03 5:41
ns15-May-03 5:41 
GeneralAIM104-Relay8/In8 Pin
Bernhard15-May-03 3:57
Bernhard15-May-03 3:57 
GeneralNeed help with DLL Pin
AnTri15-May-03 3:51
AnTri15-May-03 3:51 
GeneralRe: Need help with DLL Pin
David Crow15-May-03 4:09
David Crow15-May-03 4:09 
GeneralRe: Need help with DLL Pin
AnTri15-May-03 4:25
AnTri15-May-03 4:25 
GeneralRe: Need help with DLL Pin
David Crow15-May-03 5:22
David Crow15-May-03 5:22 
GeneralRe: Need help with DLL Pin
AnTri15-May-03 6:09
AnTri15-May-03 6:09 
GeneralRe: Need help with DLL Pin
David Crow15-May-03 6:32
David Crow15-May-03 6:32 
GeneralRe: Need help with DLL Pin
Renjith Ramachandran15-May-03 4:25
Renjith Ramachandran15-May-03 4:25 
GeneralCopying/Moving files Pin
Anonymous15-May-03 3:45
Anonymous15-May-03 3:45 
GeneralRe: Copying/Moving files Pin
Bernhard15-May-03 3:52
Bernhard15-May-03 3:52 
GeneralRe: Copying/Moving files Pin
Johnny ²15-May-03 3:53
Johnny ²15-May-03 3:53 
GeneralRe: Copying/Moving files Pin
AnkushChopra16-May-03 1:56
AnkushChopra16-May-03 1:56 
GeneralActiveX to create OfficeXp like menu Pin
Onkie15-May-03 2:13
Onkie15-May-03 2:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.