This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/34839] stl vector.resize()/assign() strange behaviour



------- Comment #2 from pcarlini at suse dot de  2008-01-17 23:21 -------
The behavior is correct. First the default constructor is used in resize, then
(you can't see it with the snippet) the copy constructor binds to that default
constructed element, used in 3 placement new; finally the destructor runs on
the default constructed element. Then again default constructor, destructor,
the same, and one additional destructor due to the resize to 2 positions (the
last element is destroyed).


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34839


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]