|
Boost : |
From: Gregory Colvin (gregory.colvin_at_[hidden])
Date: 2003-08-29 14:17:44
On Friday, Aug 29, 2003, at 12:33 America/Denver, E. Gladyshev wrote:
>
> --- Gregory Colvin <gregory.colvin_at_[hidden]> wrote:
>
> [...]
>> It's still not obvious to me. But I suspect I have yet to understand
>> your example.
>
> Perhaps Peter can help me here. In his sample solution before, in this
> thread,
> he addresses this problem nicely by using static functions
> that take references to allocator instances. In his solution,
> shared_ptr doesn't create an internal Allocator copy.
The C++ standard requires that a copy of an allocator is equivalent
to the original.
> Instead he binds a static function pointer to an Allocator instance
> and uses the pointer as Deleter.
> My sample stateful allocator will work just fine in Peter's code.
Right. If your allocators can't be copied safely then you have a
problem. Peter's approach is one way to fix the problem. But I
don't see that shared_ptr has a problem.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk