Click here to Skip to main content
15,915,093 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Deque's question Pin
smartnose28-Aug-02 15:26
smartnose28-Aug-02 15:26 
GeneralRe: Deque's question Pin
Emilio Guijarro28-Aug-02 7:19
Emilio Guijarro28-Aug-02 7:19 
GeneralRe: Deque's question Pin
Paul M Watt28-Aug-02 9:34
mentorPaul M Watt28-Aug-02 9:34 
GeneralRe: Deque's question Pin
Emilio Guijarro29-Aug-02 6:24
Emilio Guijarro29-Aug-02 6:24 
GeneralRe: Deque's question Pin
Christian Graus28-Aug-02 13:24
protectorChristian Graus28-Aug-02 13:24 
GeneralSTL: keep order for map Pin
peterchen27-Aug-02 19:38
peterchen27-Aug-02 19:38 
GeneralRe: STL: keep order for map Pin
Todd Smith27-Aug-02 20:06
Todd Smith27-Aug-02 20:06 
GeneralRe: STL: keep order for map Pin
peterchen27-Aug-02 20:59
peterchen27-Aug-02 20:59 
value is either a string, or a class mainly containing a string-string map (with the same problem):

I need fast string-based lookup, so I guess I will need a map.
(lookup is case insensitive, but original case should be preserved, a linear search in an unsorted list is probably a really bad idea)

I will continually insert, erase, and change values in the map, but at the same time, I need to iterate over the map in the same order as items were added to the map (bare thiose that were removed, of course)

e.g.

map["polonius"] = "rat"
map["ophelia"] = "dead";
map["hamlet"] = "mad";

// iterate over map so I get it in order polonius, ophelia, hamlet

map["hamlet"] = "dead";
map["polonius"] = "dead";
map.erase("ophelia");
// iterate original order again - now only polonius, hamlet

map["ophelia"] = "floating";
// iterate - now it doesn't matter if it's p-h-o, or p-o-h

if the key was an integer, I wouldn't hesitate to simply use a separate list as an index, but I wonder if there's a mroe effective method

e.g.: could I use a list< map::iterator >, or even a list <map::value_type *=""> instead? (provided I remove them from the lsit before removing them from the map) Although other iterators should not be affected by inserting / removing, I'm still a bit "shaky" on this topic...


Peter


One day I might find it quite amusing how touching tongues make life so confusing  Anne Clark again   [sighist]
GeneralRe: STL: keep order for map Pin
Todd Smith27-Aug-02 21:13
Todd Smith27-Aug-02 21:13 
GeneralRe: STL: keep order for map Pin
peterchen27-Aug-02 21:49
peterchen27-Aug-02 21:49 
GeneralRe: STL: keep order for map Pin
Joaquín M López Muñoz28-Aug-02 12:26
Joaquín M López Muñoz28-Aug-02 12:26 
GeneralRe: STL: keep order for map Pin
peterchen28-Aug-02 12:53
peterchen28-Aug-02 12:53 
GeneralATL server exe and event interface Pin
_elli_26-Aug-02 23:14
_elli_26-Aug-02 23:14 
GeneralDeque Pin
danag26-Aug-02 11:32
danag26-Aug-02 11:32 
GeneralRe: Deque Pin
danag26-Aug-02 12:14
danag26-Aug-02 12:14 
GeneralWindows service in ATL Pin
rajeev25-Aug-02 20:31
rajeev25-Aug-02 20:31 
GeneralRe: Windows service in ATL Pin
Vagif Abilov31-Aug-02 21:20
professionalVagif Abilov31-Aug-02 21:20 
QuestionDrag & Drop into a CWindowImpl? Pin
clintsinger23-Aug-02 12:43
clintsinger23-Aug-02 12:43 
AnswerRe: Drag & Drop into a CWindowImpl? Pin
Michael Dunn25-Aug-02 21:34
sitebuilderMichael Dunn25-Aug-02 21:34 
GeneralWTL FormBased APP with AX Pin
obt23-Aug-02 11:26
obt23-Aug-02 11:26 
GeneralProperty Sheet Wizard Pin
mango_lier22-Aug-02 9:42
mango_lier22-Aug-02 9:42 
GeneralCreateThread / CloseHandle cleanly Pin
Paul Farry22-Aug-02 5:14
professionalPaul Farry22-Aug-02 5:14 
GeneralRe: CreateThread / CloseHandle cleanly Pin
_Magnus_22-Aug-02 5:18
_Magnus_22-Aug-02 5:18 
GeneralRe: CreateThread / CloseHandle cleanly Pin
Paul Farry22-Aug-02 5:29
professionalPaul Farry22-Aug-02 5:29 
Generalset compiler error Pin
_Magnus_22-Aug-02 3:43
_Magnus_22-Aug-02 3:43 

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.