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 libstdc++/13864] stl_hastable.h Line 527


------- Additional Comments From gdr at integrable-solutions dot net  2004-01-26 06:38 -------
Subject: Re:  New: stl_hastable.h Line 527

"greg dot bertin at solacesystems dot com" <gcc-bugzilla@gcc.gnu.org> writes:

| _Construct(&__n->_M_val, __obj); being called with an unitialized memory 
| pointer (__n) being passed as the first parameter (i.e. it is memory allocated 
| from an allocator in line 524). Memory should be default constructed first to 
| ensure the class' copy constructor behaves properly:
| 
|     try {
|       _Construct(&__n->_M_val);
|       _Construct(&__n->_M_val, __obj);
|       return __n;
|     }

I don't understand.  Why should a default construction be needed
before a copy-construction?  A constructor is called only once in an
object lifetime.

-- Gaby


-- 


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


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