This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Why aren't assignment operators inherited automatically?
- From: Jonathan Wakely <cow at compsoc dot man dot ac dot uk>
- To: Topi Maenpaa <topiolli at ee dot oulu dot fi>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 16 Mar 2005 10:42:30 +0000
- Subject: Re: Why aren't assignment operators inherited automatically?
- References: <200503161045.16205.topiolli@ee.oulu.fi>
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