This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++ Protected Class Members are Private???
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Neil Booth <neil at daikokuya dot co dot uk>
- Cc: Mongryong <Mongryong at sympatico dot ca>, gcc at gnu dot org
- Date: 20 Feb 2003 10:58:34 +0100
- Subject: Re: C++ Protected Class Members are Private???
- Organization: Integrable Solutions
- References: <1045681848.1364.18.camel@refugeeMedia><20030219205407.GE10335@daikokuya.co.uk>
Neil Booth <neil at daikokuya dot co dot uk> writes:
| Mongryong wrote:-
|
| > // now, this generates a compiler error!!!
| > // right->left: left is protected and can't be accessed??
| > left = right->left;
|
| left = this->left is OK, but not right->left because it's a different
| object. At least, that's my understanding. Welcome to C++.
Your understanding is correct. BinaryTree didn't grant friendship to
AVLTree, therefore any direct access to a BinaryTree member from an
AVLTree member function is invalid.
-- Gaby