Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-10-18 10:48:02

"David M. Jones" <djones_at_[hidden]> writes:

> Are you telling me that this STL implementation is (slightly) invalid? Or
> are you telling me that I should not expect boost::shared_ptr to be a valid
> type for use as a custom allocator::pointer?

It is the latter. STL implementations are permitted to assume that
an allocator for a type T have pointer and reference types T* and T&


  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.

This is sometimes known among committee members as "the weasel

Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at