Topic: Giving away things (Was: Making private members protected in derived class)


Author: postmast.root.admi.gov@iname.com (blargg)
Date: 1999/09/15
Raw View
In article <37DBF004.65E4@wanadoo.fr>, Valentin Bonnard
<Bonnard.V@wanadoo.fr> wrote:

> Francis Glassborow wrote:
>
> > class Base {
> > protected:
> >         int a;
> > };
>
> > class Derived: public Base {
> > public:
> >         using Base::a;
> > };
> >
> > and you should not get a complaint from the compiler.  However you will
> > get strong complaints from competent C++ programmers that you need quite
> > exceptional reasons to do such a thing.
>
> You can always give away what people gave to you. If I tell
> you a secret, then nothing can stop you from telling everyone
> what the secret is. The only way to prevent that is to refrain
> from telling you the secret.

But this isn't a secret here. It's just knowledge that hasn't been posted
everywhere. You have to go into the library (be a derived class) to read
it.

If Base made Derived a friend, and Derived advertised this everywhere,
then I think secret would be an appropriate term.


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]






Author: Valentin Bonnard <Bonnard.V@wanadoo.fr>
Date: 1999/09/13
Raw View
Francis Glassborow wrote:

> class Base {
> protected:
>         int a;
> };

> class Derived: public Base {
> public:
>         using Base::a;
> };
>
> and you should not get a complaint from the compiler.  However you will
> get strong complaints from competent C++ programmers that you need quite
> exceptional reasons to do such a thing.

You can always give away what people gave to you. If I tell
you a secret, then nothing can stop you from telling everyone
what the secret is. The only way to prevent that is to refrain
from telling you the secret.

--

Valentin Bonnard
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]





Author: Francis Glassborow <francis@robinton.demon.co.uk>
Date: 1999/09/14
Raw View
In article <37DBF004.65E4@wanadoo.fr>, Valentin Bonnard
<Bonnard.V@wanadoo.fr> writes
>You can always give away what people gave to you. If I tell
>you a secret, then nothing can stop you from telling everyone
>what the secret is. The only way to prevent that is to refrain
>from telling you the secret.

None the less giving away secrets is a breach of trust.

Francis Glassborow      Journal Editor, Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA          +44(0)1865 246490
All opinions are mine and do not represent those of any organisation
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]