bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: templates and inheritance


From: André Pönitz
Subject: Re: templates and inheritance
Date: 12 Apr 2002 16:38:51 GMT

Greg Bacon <address@hidden> wrote:
> The following small example fails on both g++ and MSVC++ 6.0.  Is this a
> compiler bug or a bug in my understanding of the semantics?

I fear the latter.

>     class C: public B<T> {
>       public:
>         C() { cout << "C::C called\n"; }
>     };

My interpretation:
Since you do not provide an operator=() for C, the compiler will generate
one automatically, consequently hiding the ones from B.

Andre'

PS: I have not yet encountered a situation where a _virtual_ operator=
makes sense. This does, of course, not mean anything....

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]