delorie.com/archives/browse.cgi | search |
From: | "Hiram Berry" <burningb AT burningbridges DOT com> |
Newsgroups: | comp.os.msdos.djgpp,comp.lang.c++ |
Subject: | Re: How should I use the Iterator with a map??? |
Date: | 26 Jan 2000 13:29:37 EST |
Organization: | Burning Bridges Design Studio |
Lines: | 32 |
Message-ID: | <86neeh$7@journal.concentric.net> |
References: | <86mf46$4ua$1 AT news DOT lth DOT se> <5m4u8s87c42f2s9mldsrr7rgf6iaasu9fr AT 4ax DOT com> |
NNTP-Posting-Host: | ts005d12.stp-fl.concentric.net |
X-Priority: | 3 |
X-MSMail-Priority: | Normal |
X-Newsreader: | Microsoft Outlook Express 5.00.2615.200 |
X-MimeOLE: | Produced By Microsoft MimeOLE V5.00.2615.200 |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
Damian Yerrick <MYNAMEISd_yerrick AT hotmail DOT comNO2CANNEDHAM> wrote in message news:5m4u8s87c42f2s9mldsrr7rgf6iaasu9fr AT 4ax DOT com... > On Wed, 26 Jan 2000 10:33:13 +0100, "Niklas Pettersson" > <npedt97 AT student DOT vxu DOT se> wrote: > You might get more help in comp.lang.c++. Crosspost added. > > >#include <string> > >#include <map> > > > >struct SymbolTableEntry // Dummy.. Just to illustrate.. ... > >map<string, SymbolTableEntry *> symboltable_rep; ... > > map<string, SymbolTableEntry *>::iterator i( symboltable_rep.begin() ); > > SymbolTableEntry *current = 0; ... > > // ERROR HERE!!! > > // > > current = *i; // Get contents of iterator... ... I believe the value_type for maps is std::pair<const Key,T>, so in this case I think you need to write current = i -> second; in order to get the SymbolTableEntry * value.
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |