Fix tree containers debug mode C++11 allocator awareness

François Dumont frs.dumont@gmail.com
Mon Jan 13 20:16:00 GMT 2014


On 12/22/2013 09:55 PM, François Dumont wrote:
> On 12/22/2013 12:51 PM, Jonathan Wakely wrote:
>> On 21 December 2013 08:51, François Dumont wrote:
>>> Any feedback for this proposal ?
>> It looks good but I don't have time to review it fully yet, please be 
>> patient.
>>
>> I'm more concerned about your comment about the non-debug mode
>> implementation being incorrect, could you provide more details?
>> .
>>
>     That's not a big issue. The constructor taking a rvalue reference 
> and an allocator doesn't take care about safe iterators. They should 
> be swap like in the move constructor when allocator is equivalent and 
> invalidated if we have not been able to move memory. I plan to submit 
> a patch to fix all implementations the same way at once but I can 
> include it in this patch if you prefer.
>

Following agreement given here:

http://gcc.gnu.org/ml/libstdc++/2014-01/msg00066.html

Attached patch applied.

Profile mode will need the same kind of patch too.

2014-01-13  François Dumont  <fdumont@gcc.gnu.org>

     * include/debug/set.h (set): Implement C++11 allocator-aware
     container requirements.
     * include/debug/map.h (map): Likewise.
     * include/debug/multiset.h (multiset): Likewise.
     * include/debug/multimap.h (multimap): Likewise.
     * include/debug/set.h (set::operator=(set&&)): Add noexcept and
     fix implementation regarding management of safe iterators.
     * include/debug/map.h (map::operator=(map&&)): Likewise.
     * include/debug/multiset.h (multiset::operator=(multiset&&)): Likewise.
     * include/debug/multimap.h (multimap::operator=(multimap&&)):
     Likewise.
     * include/debug/set.h (set::operator=(std::initializer_list<>)):
     Rely on the same operator from normal mode.
     * include/debug/map.h (map::operator=(std::initializer_list<>)):
     Likewise.
     * include/debug/multiset.h
     (multiset::operator=(std::initializer_list<>)): Likewise.
     * include/debug/multimap.h
     (multimap::operator=(std::initializer_list<>)): Likewise.
     * include/debug/set.h (set::swap(set&)): Add noexcept
     specification, add allocator equality check.
     * include/debug/map.h (map::swap(map&)): Likewise.
     * include/debug/multiset.h (multiset::swap(multiset&)): Likewise.
     * include/debug/multimap.h (multimap::swap(multimap&)): Likewise.

François

-------------- next part --------------
A non-text attachment was scrubbed...
Name: c++11_alloc.patch
Type: text/x-patch
Size: 10914 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20140113/6ac0151c/attachment.bin>


More information about the Libstdc++ mailing list