Click here to Skip to main content
15,925,255 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: set<int>::find crashing Pin
Paul M Watt2-Apr-02 13:08
mentorPaul M Watt2-Apr-02 13:08 
GeneralRe: set<int>::find crashing Pin
Cathy2-Apr-02 13:15
Cathy2-Apr-02 13:15 
GeneralRe: set<int>::find crashing Pin
Paul M Watt2-Apr-02 14:06
mentorPaul M Watt2-Apr-02 14:06 
GeneralRe: set<int>::find crashing Pin
Cathy3-Apr-02 7:19
Cathy3-Apr-02 7:19 
GeneralRe: set<int>::find crashing Pin
Mike Nordell2-Apr-02 22:28
Mike Nordell2-Apr-02 22:28 
GeneralRe: set<int>::find crashing Pin
Cathy3-Apr-02 6:47
Cathy3-Apr-02 6:47 
GeneralRe: set<int>::find crashing Pin
Mike Nordell15-Apr-02 12:48
Mike Nordell15-Apr-02 12:48 
GeneralRe: set<int>::find crashing Pin
Cathy15-Apr-02 13:14
Cathy15-Apr-02 13:14 
Mike Nordell wrote:
You shall never, I repeat never, compare an iterator to any other iterator than for equality or inequality. Even that a vector is to be contigous, there is AFAIK nothing stating that a vector iterator has to be implemented as a pointer to the contents, why something like:
if (it < coll.end())

is incorrect code. It should be
if (it != coll.end())


Thanks for pointing that out! I didn't notice that one at all.

Mike Nordell wrote:
But be aware that keeping pointers to objects in two collections if the one owning the object can delete it during the lifetime of the second referee is obviously inherently dangerous.

Yes, this was the problem. I was storing a pointer that was no longer valid.

Cathy

Life's uncertain, have dessert first!
GeneralWorkspace & Projects Pin
AJ1232-Apr-02 10:38
AJ1232-Apr-02 10:38 
GeneralRe: Workspace & Projects Pin
Joaquín M López Muñoz2-Apr-02 10:39
Joaquín M López Muñoz2-Apr-02 10:39 
GeneralRe: Workspace & Projects Pin
Nemanja Trifunovic2-Apr-02 10:48
Nemanja Trifunovic2-Apr-02 10:48 
GeneralRe: Workspace & Projects Pin
AJ1233-Apr-02 10:31
AJ1233-Apr-02 10:31 
GeneralRe: Workspace & Projects Pin
Tim Smith3-Apr-02 10:47
Tim Smith3-Apr-02 10:47 
QuestionCSliderCtl and Arrow Keys? Pin
Ken Goguen2-Apr-02 9:21
Ken Goguen2-Apr-02 9:21 
AnswerRe: CSliderCtl and Arrow Keys? Pin
Joaquín M López Muñoz2-Apr-02 10:23
Joaquín M López Muñoz2-Apr-02 10:23 
GeneralRe: CSliderCtl and Arrow Keys? Pin
Ken Goguen3-Apr-02 7:56
Ken Goguen3-Apr-02 7:56 
Generalthread problem Pin
Merle Pittman2-Apr-02 7:59
Merle Pittman2-Apr-02 7:59 
GeneralRe: thread problem Pin
Joaquín M López Muñoz2-Apr-02 8:28
Joaquín M López Muñoz2-Apr-02 8:28 
GeneralOCX uUid collision nightmare Pin
megaadam2-Apr-02 7:39
professionalmegaadam2-Apr-02 7:39 
GeneralRe: OCX uUid collision nightmare Pin
Derek Waters2-Apr-02 12:29
Derek Waters2-Apr-02 12:29 
QuestionSaving a Document with values from dynamic array? Pin
dazinith2-Apr-02 6:28
dazinith2-Apr-02 6:28 
AnswerRe: Saving a Document with values from dynamic array? Pin
Ravi Bhavnani2-Apr-02 6:43
professionalRavi Bhavnani2-Apr-02 6:43 
GeneralRe: Saving a Document with values from dynamic array? Pin
dazinith2-Apr-02 8:07
dazinith2-Apr-02 8:07 
GeneralRe: Saving a Document with values from dynamic array? Pin
Ravi Bhavnani2-Apr-02 8:22
professionalRavi Bhavnani2-Apr-02 8:22 
GeneralRe: Saving a Document with values from dynamic array? Pin
dazinith2-Apr-02 8:41
dazinith2-Apr-02 8:41 

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.