[Exceptional C++ Style] Item 14: Order, Order!

White Wolf wolof at freemail.hu
Tue Dec 14 16:16:54 EST 2004


Sam wrote:
[SNIP]
>>> Why?  A member does not depend on the class containing it.
>> 
>> Err, yes it does: that is fundamental to the definition of
>> membership! 
> 
> Are you two talking about the same thing?
> 
> It looks like Kevlin is speaking about member _functions_ and
> WW about member _data_. It is obvious to me that function
> membership provides the strongest binding, but, in C++, data
> membership surely has a weaker binding than both friendship
> and inheritance?

I guess the source of confusion from my part was that I do not think of
member functions as entities related to a class.  I think of them as the
entities which _are_ or _make_ the class.  A bit more so than members, I
think quite a bit.  I can imagine a class with no state but behaviour and
still call it a class.  But I have trouble imagining anything worth of
calling a class but having no behaviour only state. :-)  I can call it a
bag, a struct, a Record a'la Pascal, structured storage... many things but
not a class.  Call me narrow minded. ;-)

And I am sorry for intruding into Item 15, I just had to break again the
"never explain, never complain" rule.  Opps, I did it again.

But seriously.  I wanted to tell all those things about members above,
because I have the gut feeling that I just did touch on something essential.
Possibly this was something already clearly obvious to everyone else...  In
that case, I am sorry.

If someone wishes to discuss this any further or react, please do so in
private.

WW aka Attila

Ps: Sorry for the mixed US-UK spelling.  I'm trying to recall the UK one.





More information about the Effective-cpp mailing list