|
Re: Override Private: msg#00277gcc.help
Hi Liguo, A private virtual function allows a derived class to implement behavior that is used by the base class. See C++PL 24.3.2.1 The situation you are describe relies on a happenstance where cavalier casting that relies on the serendipity that the signatures in the vptrtbl will happen to be in the same offset for the derived class as in the base class, and thus casting-with-the-big-hammer avoids the compiler catching the breach of access. Casting in such a fashion is a source of bugs. Should be avoided. Sincerely, --Eljay |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Override Private: 00277, Liguo Song |
|---|---|
| Next by Date: | Re: Override Private: 00277, Liguo Song |
| Previous by Thread: | Override Privatei: 00277, Liguo Song |
| Next by Thread: | Re: Override Private: 00277, Liguo Song |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |