|
Boost : |
From: David B. Held (dheld_at_[hidden])
Date: 2002-05-02 15:03:57
"David Abrahams" <david.abrahams_at_[hidden]> wrote in message
news:00c201c1f210$ccdc9050$6401a8c0_at_boostconsulting.com...
>
> From: "Andrei Alexandrescu" <andrewalex_at_[hidden]>
> > [...]
> > Hey, I think it would be a great idea to use private inheritance.
> > That way, policies can enhance interface only through free
> > functions, which is my intent anyway. What do others think?
I personally don't like free function interfaces, but I could live with
them. I guess I'm thinking that maybe:
smart_ptr<FILE, ...> f;
f.write("Hello, world!");
is better than:
write(f, "Hello, world!");
I guess that's just a matter of personal style. But if I saw the
latter form in someone else's code, I would go looking for a
namespace level free function, instead of checking out the
pointer policies.
> To put it another way, is it important to use inheritance at all?
Are you suggesting that outright containment might be an option?
That would also force top-level forwarding of all interfaces, eh?
> Are you using the Barton/Nackman trick? If so, I am in principle
> in favor of private inheritance.
What's the Barton/Nackman trick?
Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk