[patch] fix libstdc++/56278

François Dumont frs.dumont@gmail.com
Tue Feb 12 20:54:00 GMT 2013


On 02/11/2013 01:21 AM, Jonathan Wakely wrote:
>          PR libstdc++/56278
>          * include/bits/hashtable_policy.h (_Hash_code_base): Make default
>          constructor public.
>          * testsuite/23_containers/unordered_set/56278.cc: New.
>
> Tested x86_64-linux, committed to trunk.
     In fact we do not need the default constructor to be public. It is 
the static assertion in hashtable that is not accurate enough. 
std::is_default_constructible is in fact a 
std::is_publicly_default_constructible which is more than we need. Here 
is a patch that restore default constructor protected and check that 
_Hash_code_base is default constructible through inheritance.

     Of course this is not mandatory but I think _Hash_code_base would 
be cleaner this way only exposing as public what is required by C++11. 
It can also wait for 4.9.

     Tested under Linux x86_64.

2013-02-12  François Dumont  <fdumont@gcc.gnu.org>

     * include/bits/hashtable_policy.h (_Hash_code_base): Restore
     default constructor protected.
     * include/bits/hashtable.h: static assert that _Hash_code_base has
     a default constructor available through inheritance.

François

-------------- next part --------------
A non-text attachment was scrubbed...
Name: hash_code_base.patch
Type: text/x-patch
Size: 2174 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20130212/7a6a1493/attachment.bin>


More information about the Libstdc++ mailing list