[Bug libstdc++/44068] New: std::map deals with keys of objects that were not constructed
It looks like bug thag std::map can create it's elements without calling it's constructors and compare keys of such objects. This is example code that illustrates problem. Every time new object of type Node is constructed it's address is stored in vector "ptrs". Any time member function is called value of "this" poiter is searched in this vector. On my machine I see message "EPIC FAIL" every time I try to run the program. Here are the code: http://pastebin.com/8Qc3V7St I thing it should be in utf-8 when it's compiled. -- Summary: std::map deals with keys of objects that were not constructed Product: gcc Version: 4.4.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: devinull dot v42 at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44068
[Bug libstdc++/44068] std::map deals with keys of objects that were not constructed
--- Comment #4 from devinull dot v42 at gmail dot com 2010-05-10 22:57 --- (In reply to comment #2) > Your operator< is not valid. It must be a strict-weak ordering. > > In particular, it must not be possible that A < B and B < A, but in your code > this is possible. > Thank you, Chris. I'm an idiot ) -- devinull dot v42 at gmail dot com changed: What|Removed |Added CC| |devinull dot v42 at gmail | |dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44068