Click here to Skip to main content
15,867,453 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionStill Struggling with map::insert and operator overload Pin
ForNow20-Dec-22 15:57
ForNow20-Dec-22 15:57 
AnswerRe: Still Struggling with map::insert and operator overload Pin
Mircea Neacsu20-Dec-22 17:34
Mircea Neacsu20-Dec-22 17:34 
GeneralRe: Still Struggling with map::insert and operator overload Pin
ForNow21-Dec-22 1:51
ForNow21-Dec-22 1:51 
QuestionMessage Closed Pin
18-Dec-22 5:01
ForNow18-Dec-22 5:01 
AnswerRe: Question about return value of STD MAP::INSERT Pin
Mircea Neacsu18-Dec-22 6:55
Mircea Neacsu18-Dec-22 6:55 
GeneralRe: Question about return value of STD MAP::INSERT Pin
ForNow18-Dec-22 7:08
ForNow18-Dec-22 7:08 
GeneralRe: Question about return value of STD MAP::INSERT Pin
ForNow18-Dec-22 8:05
ForNow18-Dec-22 8:05 
AnswerRe: Question about return value of STD MAP::INSERT Pin
Mircea Neacsu18-Dec-22 8:14
Mircea Neacsu18-Dec-22 8:14 
std::map::insert returns a pair. Nothing you can do about that.

Your code should look like:
C++
map<uint32_t, extsymbol> ::iterator extsymiter;
auto ret = procpointer->extsymcollector->insert({exsympointer->SYMESDID, * exsympointer });
if (ret.second)
  extsymiter = ret.first;
else
  //map already had an element with same key


If you don't care if the element was there or not, you can just skip the if.
Mircea

GeneralRe: Question about return value of STD MAP::INSERT Pin
ForNow18-Dec-22 8:31
ForNow18-Dec-22 8:31 
Questionhow to typedef array of 4 char to be used in map template Pin
ForNow13-Dec-22 14:17
ForNow13-Dec-22 14:17 
AnswerRe: how to typedef array of 4 char to be used in map template Pin
CPallini13-Dec-22 21:05
mveCPallini13-Dec-22 21:05 
GeneralRe: how to typedef array of 4 char to be used in map template Pin
ForNow14-Dec-22 1:47
ForNow14-Dec-22 1:47 
GeneralRe: how to typedef array of 4 char to be used in map template Pin
CPallini14-Dec-22 2:17
mveCPallini14-Dec-22 2:17 
GeneralRe: how to typedef array of 4 char to be used in map template Pin
ForNow14-Dec-22 2:30
ForNow14-Dec-22 2:30 
GeneralRe: how to typedef array of 4 char to be used in map template still getting compile errors Pin
ForNow15-Dec-22 2:24
ForNow15-Dec-22 2:24 
GeneralRe: how to typedef array of 4 char to be used in map template still getting compile errors Pin
CPallini15-Dec-22 3:01
mveCPallini15-Dec-22 3:01 
GeneralRe: how to typedef array of 4 char to be used in map template still getting compile errors Pin
ForNow15-Dec-22 3:12
ForNow15-Dec-22 3:12 
GeneralRe: how to typedef array of 4 char to be used in map template still getting compile errors Pin
CPallini15-Dec-22 3:22
mveCPallini15-Dec-22 3:22 
GeneralRe: how to typedef array of 4 char to be used in map template still getting compile errors Pin
ForNow15-Dec-22 3:33
ForNow15-Dec-22 3:33 
QuestionRe: how to typedef array of 4 char to be used in map template still getting compile errors Pin
CPallini15-Dec-22 3:40
mveCPallini15-Dec-22 3:40 
AnswerRe: how to typedef array of 4 char to be used in map template still getting compile errors Pin
ForNow15-Dec-22 3:51
ForNow15-Dec-22 3:51 
GeneralRe: how to typedef array of 4 char to be used in map template my solution CPallini hope you read this thank you Pin
ForNow15-Dec-22 12:47
ForNow15-Dec-22 12:47 
GeneralRe: how to typedef array of 4 char to be used in map template my solution CPallini hope you read this thank you Pin
CPallini15-Dec-22 20:46
mveCPallini15-Dec-22 20:46 
GeneralRe: how to typedef array of 4 char to be used in map template my solution CPallini hope you read this thank you Pin
ForNow16-Dec-22 2:40
ForNow16-Dec-22 2:40 
GeneralRe: how to typedef array of 4 char to be used in map template my solution CPallini hope you read this thank you Pin
CPallini16-Dec-22 3:00
mveCPallini16-Dec-22 3:00 

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.