Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2003-11-24 22:35:47


"Larry Evans" <cppljevans_at_[hidden]> wrote in message
news:bprttf$sd7$1_at_sea.gmane.org...
> [...]
> So, the return value should be P* not a P.
> In addition, get_impl(rhs), which is storage_policy::get_impl(rhs),
> returns a P* instead of the (P const&) which is declared as the
> argument to clone.
>
> Please let me know if I'm wrong.

Well, it's a little tricky here. In the policies, 'P' means 'pointer
type'. We really should have put a typedef in there to make it
explicit, but if you read the book, you would have known that,
and I only made changes that I had to. ;> You could argue
that if P means 'pointer type', then it should really be spelled
T*, but then, that would force the pointer type to be a real
pointer type (rather than, say, a nested smart pointer or some
other gizmo). Unfortunately, the policy adaptor makes it almost
impossible to see that P is getting passed
stored_type::pointer_type, but that is indeed the case.

Dave

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.538 / Virus Database: 333 - Release Date: 11/10/2003

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