This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Why aren't assignment operators inherited automatically?


On Wed, Mar 16, 2005 at 10:45:16AM +0200, Topi Maenpaa wrote:

> In short, anything inherited from the base class can be used as expected, 
> except the assignment operator. What's the deal? I'm doing this on Mandrake 
> 10.1, gcc 3.4.1, if that matters.

This question is about C++, not the development of GCC, so would be
better suited somewhere like comp.lang.c++

Basically, G++ does what the standard requires.  The assignment operator
is special, if you don't declare one the compiler does so implicitly and
the implicit operator= hides the inherited one.

See a good C++ reference for "name hiding".

jon


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]