Rewriting bitmap_allocator
Jonathan Wakely
jwakely.gcc@gmail.com
Thu Jul 26 09:12:00 GMT 2012
On 25 July 2012 23:36, Dhruv Matani wrote:
> Thanks Jonathan!
>
> So, just to confirm, I need to determine if the current allocator can
> be passed to std::allocator_traits<Alloc>
It can be. The current allocator meets the C++03 allocator
requirements, so can be used with allocator_traits.
There's no need to check anything else. If bitmap_allocator is
supposed to be a drop-in replacement for std::allocator then it needs
to be stateless, and the default behaviour provided by
allocator_traits is correct for that case, except that it should
define propagate_on_container_move_assignment to true, see
http://cplusplus.github.com/LWG/lwg-active.html#2103
> (which happens to be
> available only post 4.6.2) right?
4.7.0 onwards, but I would expect any changes to bitmap_allocator to
only be done on trunk (4.8) anyway.
More information about the Libstdc++
mailing list