Lars Gullik Bjønnes wrote:

> Angus Leeming <[EMAIL PROTECTED]> writes:
> 
> | This patch is a 'pragmatic pimpl-ing' of BufferParams. It moves into Impl
> | only those member variables that currently drag in header files into
> | bufferparams.h.
>>
> | I had two choices when implementing it.
> | * Explicitly define a copy constructor and assignment operator for
> | BufferParams.
> | * Define a smart pointer with copy semantics.
>>
> | I chose the latter approach, defining a cow_ptr with copy-on-write
> | semantics. It uses boost::shared_ptr to store the data and so was trivial
> | to implement.
>>
> | We could later use cow_ptr as a direct replacement of math_atom, f.ex.
>>
> | What do you think? Ok to apply?
> 
> I think I have seen a "cow_ptr" that is a bit more general somewhere.
> 
> either in a Sutter book or in Modern C++ Design.
> (could be in boost as well...)

Not in boost. CVS has:
intrusive_ptr.hpp scoped_ptr.hpp shared_ptr.hpp smart_ptr.hpp weak_ptr.hpp

The Loki library certainly has one, but I think that this one is perfectly 
acceptable. It was written by Yonat Sharon: http://ootips.org/yonat/
I just used boost::shared_ptr internally rather than his hand-written 
equivalent. I have changed the authorship of the file appropriately ;-)

Anyway, can I apply the patch?

-- 
Angus

Reply via email to