Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error with stl push_front in release version only

Status
Not open for further replies.

jennyy

Programmer
Jan 9, 2003
8
US
Does anyone have any ideas about what's causing the following behavior? When I run my code that includes an stl list push_front in debug mode, it runs fine. When I create a release version with partial debugging enabled, and run with my program with the .net option "start" it runs fine. But when I run the program via "start without debugging" the release version, it breaks. When I run it with a release version with no debugging enabled at all, it breaks. The break occurs directly after the list push_front (but only on some executions of this command and not others)--i.e. sometimes push_front works and other times I can print out my list before the push_front, but if i try and print out my list after the push_front I get all kinds of problems with referencing null pointers or unintialized data. These errors do not occur with the item that i am pushing on to the list--rather the errors occur usually on the 4th or 5th element in the list (though I have had them occur on the 2nd element too). I can't figure out what i'm doing wrong. I belive that my copy constructors are correct, and even so I can't figure out why push front would modify elements in the middle of the list anyways. DOES ANYONE KNOW WHAT COULD BE CAUSING THIS?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top