Containers default initialization

François Dumont frs.dumont@gmail.com
Sun Jun 4 20:26:00 GMT 2017


Hi

     I have eventually adapt the test to all containers and the result 
is successful for map/set/unordered_map/unordered_set. It is failing for 
deque/list/forward_list/vector/vector<bool>.

     I even try to change the test to look at the difference between an 
explicit call to the default constructor done through the placement new 
call and an implicit call done on normal declaration. I wondered if we 
would have the same kind of difference we have between a int i; and a 
int i(); I tried to set the stack to ~0 before declaring the instance. I 
know there is no guarantee on the content of the stack for the following 
declaration but do you think it is reliable enough to commit it ?

     Ok to commit the successful tests ?

     Franckly I don't understand the result of those tests. I would have 
expect map/set to fail and others to succeed. We might need help from 
compiler guys, no ?

François



-------------- next part --------------
A non-text attachment was scrubbed...
Name: default_init_tests.patch
Type: text/x-patch
Size: 9030 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20170604/d7d07d4f/attachment.bin>


More information about the Libstdc++ mailing list