using declaration and miranda functions

R

red floyd

Someone asked me about the construct below:

class Base {
public:
// all other elements redacted
Base& operator=(const Base&);
};

class Derived : public Base {
public:
using Base::eek:perator=;
};

My response was first, "don't do that". Followed by the observation
that 7.3.3 seems to allow this, but what I believe happens is that you
still get the compiler-provided Derived::eek:perator=, with an override for
an RHS of const Base&. Is this correct?

Thanks,

red floyd
 
V

Victor Bazarov

red said:
Someone asked me about the construct below:

class Base {
public:
// all other elements redacted
Base& operator=(const Base&);
};

class Derived : public Base {
public:
using Base::eek:perator=;
};

My response was first, "don't do that". Followed by the observation
that 7.3.3 seems to allow this, but what I believe happens is that you
still get the compiler-provided Derived::eek:perator=, with an override
for an RHS of const Base&. Is this correct?

Two operators are _overloaded_. "Override" only applies to virtual
functions. Other than that, yes.

V
 
R

red floyd

Victor said:
Two operators are _overloaded_. "Override" only applies to virtual
functions. Other than that, yes.

V

Victor, thanks for correcting my verbage... I mean overload, of course.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top