Boost logo

Boost :

From: Andrei Alexandrescu (andrewalex_at_[hidden])
Date: 2002-01-13 05:10:41


> That is not exactly true, cause Clone part belong to Ownership
> Policy, while it may require some knowledge belonging to
> StoragePolicy. For example, how whould you implement DeepCopy smart
> pointer over arrays?
> To cut the knot the framework should be enhanced somehow. For example:
> If OwnershipPolicy::Clone returns false (you will need to make
> current result a second argument), meaning that it fails to perform a
> clone, than the framework would use StoragePolicy::DeepCopy to
> perform as least deep copy. I am not sure how generic it is and how
> would I like such a solution but we need something like this.

The real world is messy. In an ideal world, you write policies in complete
isolation of each other and you combine them freely. In the real world,
there are ties between policies as you mention. The current design makes a
best-effort approach to isolate policies while keeping them reasonably
lucrative. I'm sure we can come up with an improved design.

Andrei

---------------------------------
Check out THE C++ Seminar: 3 Days with 5 Experts
http://www.gotw.ca/cpp_seminar/


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk