3 ms·
I don't think I've ever seen C++ that inherited an interface privately. That said, it's extremely common for classes to lack any virtual functions and thus be
by marshray 13y ago
I don't think I've ever seen C++ that inherited an interface privately.
That said, it's extremely common for classes to lack any virtual functions and thus be unusable with dynamic_cast.
- nly 13y agoWell protected is the default.
- pjmlp 13y agoThe default is private for classes and public for structs. Section 11.2 of the C++ standard.
- pjmlp 13y agoBy default it is private. Usually private inheritance is mostly used for library code, as a way for code reuse but without exposing the inheritance relationship to the class users. Also coupled with mixins sometimes.