[v3] add max_size and rebind to __alloc_traits
Daniel Krügler
daniel.kruegler@googlemail.com
Thu Oct 6 12:56:00 GMT 2011
2011/10/6 Daniel Krügler <daniel.kruegler@googlemail.com>:
> I haven't run the test (so I don't know the particular failure), but looking at
> the test code it looks broken for C++11 and implementation-defined for
> C++03. The reason why it is broken in C++11 is:
>
> 1) allocator_traits<__gnu_test::uneq_allocator>::type>::propagate_on_container_swap
> is false_type (or I missed to find a specialization that corrects
> this), this means
> vector::swap shall not swap it.
>
> 2) a.get_allocator() != b.get_allocator() is not satisfied within
> vector::swap, therefore
> the behaviour is undefined.
>
> This is a view from a "up on the mountain", so there could be a lot of
> details I missed.
>
> One necessary fix seems to add a specialization
>
> allocator_traits<__gnu_test::uneq_allocator>::type>
>
> with the correct value for propagate_on_container_swap.
Or much easier: Define propagate_on_container_swap as static
member of __gnu_test::uneq_allocator.
- Daniel
More information about the Libstdc++
mailing list