|
Boost : |
From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-04-27 09:26:34
"David Abrahams" <dave_at_[hidden]> wrote in message
news:u8y342xnj.fsf_at_boost-consulting.com...
| "Thorsten Ottosen" <nesotto_at_[hidden]> writes:
|
| > "Peter Dimov" <pdimov_at_[hidden]> wrote in message
| > news:099701c54ab2$8f8fb080$6401a8c0_at_pdimov2...
| > | Thorsten Ottosen wrote:
| >
| > | > I think you have to explain why they are not different then.
| > | The burden of proof lies usually with the person making the
| > | statement. ;-)
| >
| > no, the burden of proof lies on the person making the controversial
| > statement; in this case you.
|
| Controversialness is in the eye of the beholder, and regardless,
| Peter's right: by convention, the burden of proof lies with the
| claimant.
I disagree.
| That's very practical, because if you're saying something
| so obvious and "uncontroversial" it should be very _very_ simple to
| demonstrate it.
Pick up you're favourite book on OO and on STL and see if the programming
techniques look alike.
| > stuff like "value-based programming is not different from
| > OO-programming"
|
| Nobody made that statement.
Peter asked the question.
| > | The reference semantics vs value semantics axis is orthogonal to OO,
| > | in my opinion. The fact that in C++ you can't (efficiently) have
| > | polymorphism with value semantics doesn't mean that copying a value
| > | and copying a polymorphic object are conceptually or fundamentally
| > | different. A cloning pointer is a very good approximation of a
| > | polymorphic value. I don't see why you consider it conceptually
| > | different from a value.
| >
| > because you had to put "polymorphic" in front of "value" to describe
| > what it means;
|
| The user can't tell a Pimpl with a polymorphic impl from one without.
| They both just look like values, and all those behavioral variations
| that are implemented with virtual functions could just as well be
| implemented with "if" statements. Nobody (except maybe you) has a
| problem with allowing pimpls to have copy ctors -- impls often have
| clone() functions just to serve those copy ctors. A ptr_container is
| almost exactly like a multi-pimpl or a pimpl aggregate.
I'm not prohibiting you from copying something with clone(), it just not the
default behavior.
| > polymorphic objects don't have value-based copy-semantics; you can't
| > provide meaningful copy-constructor and copy-assignment operators.
|
| Sure they do. You only can't provide a meaningful copy ctor and copy
| assignment for an abstract base class.
and then you get the nice slicing behavior.
-Thorsten
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk