This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Is any support planned for non-equal allocator instances?
- From: Jonathan Lennox <lennox at cs dot columbia dot edu>
- To: libstdc++ at gcc dot gnu dot org
- Date: Fri, 2 Dec 2005 17:20:13 -0500
- Subject: Is any support planned for non-equal allocator instances?
The C++ standard allows STL containers to assume that there is only one
instance of any given allocator type, but encourages implementations to go
beyond that:
20.1.5 Allocator Requirements [lib.allocator.requirements]
4 Implementations of containers described in this International Standard
are permitted to assume that their Allocator template parameter meets
the following two additional requirements beyond those in Table 32.
-- All instances of a given allocator type are required to be
interchangeable and always compare equal to each other.
-- The typedef members pointer, const_pointer, size_type, and
difference_type are required to be T*, T const*, size_t, and
ptrdiff_t, respectively.
5 Implementors are encouraged to supply libraries that can accept
allocators that encapsulate more general memory models and that support
nonequal instances. In such implementations, any requirements imposed on
allocators by containers beyond those requirements that appear in Table
32, and the semantics of containers and algorithms when allocator
instances compare nonequal, are implementation-defined.
Is any such support planned for libstdc++?
--
Jonathan Lennox
lennox at cs dot columbia dot edu