Click here to Skip to main content
16,013,440 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to set an event multiple times in multithreading Pin
Bhikshapathi Gorantla2-Apr-02 2:36
Bhikshapathi Gorantla2-Apr-02 2:36 
AnswerRe: How to set an event multiple times in multithreading Pin
Joaquín M López Muñoz2-Apr-02 5:30
Joaquín M López Muñoz2-Apr-02 5:30 
GeneralRe: How to set an event multiple times in multithreading Pin
Bhikshapathi Gorantla2-Apr-02 19:30
Bhikshapathi Gorantla2-Apr-02 19:30 
GeneralRe: How to set an event multiple times in multithreading Pin
Neville Franks2-Apr-02 20:05
Neville Franks2-Apr-02 20:05 
GeneralRe: How to set an event multiple times in multithreading Pin
Joaquín M López Muñoz2-Apr-02 20:28
Joaquín M López Muñoz2-Apr-02 20:28 
QuestionSTL::map, how to prevent use of temporary object? Pin
vmaltsev2-Apr-02 1:10
vmaltsev2-Apr-02 1:10 
AnswerRe: STL::map, how to prevent use of temporary object? Pin
Giles2-Apr-02 1:16
Giles2-Apr-02 1:16 
AnswerRe: STL::map, how to prevent use of temporary object? Pin
Joaquín M López Muñoz2-Apr-02 2:15
Joaquín M López Muñoz2-Apr-02 2:15 
The temporary object myClassObj2 is created as part of the pair passed to map::insert, as you correctly guessed. This pair is used then internally to recreate the object to be inserted. Unfortunately, the value passed to map::insert cannot be used directly for two reasons:
  1. What is passed is a const reference, with which little can be done except replicate it.
  2. The object actually inserted into the map is allocated by special means (namely resorting to an STL allocator), so the pair you just passed simply does not fit.
I hope this helped you understand the problem. In short, you can't get rid of the temporary object in any easy way. If it is very important not to do excessive copying you should go to some approach using ref-counted pointers or something like that.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
AnswerRe: STL::map, how to prevent use of temporary object? Pin
Christian Graus2-Apr-02 9:35
protectorChristian Graus2-Apr-02 9:35 
GeneralRe: STL::map, how to prevent use of temporary object? Pin
vmaltsev2-Apr-02 23:03
vmaltsev2-Apr-02 23:03 
GeneralRe: STL::map, how to prevent use of temporary object? Pin
Joaquín M López Muñoz3-Apr-02 7:35
Joaquín M López Muñoz3-Apr-02 7:35 
GeneralConverts TCHAR to Managed String Pin
Ignacio Varas2-Apr-02 0:03
Ignacio Varas2-Apr-02 0:03 
GeneralRe: Converts TCHAR to Managed String Pin
2-Apr-02 2:31
suss2-Apr-02 2:31 
GeneralRe: Converts TCHAR to Managed String Pin
Le centriste2-Apr-02 6:44
Le centriste2-Apr-02 6:44 
GeneralRe: Converts TCHAR to Managed String Pin
Tim Smith2-Apr-02 7:28
Tim Smith2-Apr-02 7:28 
Questionhow to Maximize control ? Pin
2-Apr-02 0:01
suss2-Apr-02 0:01 
AnswerRe: how to Maximize control ? Pin
2-Apr-02 1:06
suss2-Apr-02 1:06 
QuestionHow can I retrieve the documents icon? Pin
AmarB2-Apr-02 0:02
AmarB2-Apr-02 0:02 
AnswerRe: How can I retrieve the documents icon? Pin
Mukkie2-Apr-02 5:25
Mukkie2-Apr-02 5:25 
GeneralToolbar in ActiveX control Pin
Tzoockee1-Apr-02 23:44
Tzoockee1-Apr-02 23:44 
GeneralRe: Toolbar in ActiveX control Pin
KaЯl2-Apr-02 4:44
KaЯl2-Apr-02 4:44 
GeneralMessage Removed Pin
1-Apr-02 22:42
suss1-Apr-02 22:42 
GeneralRe: Strings and strange characters Pin
Joaquín M López Muñoz1-Apr-02 22:44
Joaquín M López Muñoz1-Apr-02 22:44 
GeneralRe: Strings and strange characters Pin
1-Apr-02 23:51
suss1-Apr-02 23:51 
GeneralRe: Strings and strange characters Pin
Michael Dunn2-Apr-02 4:46
sitebuilderMichael Dunn2-Apr-02 4:46 

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.