How to understand FAQ 24.4

T

thomas

link: http://www.parashift.com/c++-faq-lite/private-inheritance.html#faq-24.4

There's a sentence:

"However users of PrivatelyDer should avoid this unsafe conversion,
since it is based on a private decision of PrivatelyDer, and is
subject to change without notice. "

Does it mean that PrivatelyDer decides to make the base class private,
so users should not publicly use a base pointer? Because private
inheritance intends the hide of base class, the use of Base type
pointer should be avoided.
 
J

James Kanze

There's a sentence:
"However users of PrivatelyDer should avoid this unsafe conversion,
since it is based on a private decision of PrivatelyDer, and is
subject to change without notice. "
Does it mean that PrivatelyDer decides to make the base class private,
so users should not publicly use a base pointer? Because private
inheritance intends the hide of base class, the use of Base type
pointer should be avoided.

It means that private inheritance, like anything else private,
is an implementation detail, not part of the contract, and the
client code shouldn't count on it; the authors of client code
should, in fact, code as if it didn't exist, or at least as if
they don't know of its existance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top