|
Boost : |
From: Howard Hinnant (hinnant_at_[hidden])
Date: 1999-11-23 16:36:55
Michel AndrÈ wrote on 11/23/99 3:54 PM
>Ok and make the rebind struct and typedef inside as a part of your
>standard allocator so it can be passed in to the auto_ptr used into
>your container implementation?
Already done. The standard requires that all allocators to be used with
std::containers (both user supplied and vendor supplied) have the
interface described in 20.1.5.
So if a client ignorant of the "auto_ptr" in vector writes:
template <class T>
class MyAllocator {...}
vector<MyClass, MyAllocator<MyClass> > v(...);
Then his MyAllocator will get installed into the vector's "auto_ptr" and
be guaranteed to work because we are all following the standard specified
interface for allocators. (assuming we can actually pull all this off!)
-Howard
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk