Is any support planned for non-equal allocator instances?

Jonathan Lennox lennox@cs.columbia.edu
Fri Dec 2 22:20:00 GMT 2005


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



More information about the Libstdc++ mailing list