D
developereo
Hi folks,
Can anybody shed some light on this problem?
class Interface {
public:
Interface() { ...}
virtual ~Interface() { ...}
virtual method() = 0;
};
class Impl1: public Interface {
public:
Impl1() { ...}
Impl1(const Interface&); // problem 1
virtual ~Impl1() { ... }
Impl1& operator=(const Interface&); // problem 2
};
The problem is that the compiler insists on generating the following
methods:
Impl1(const Impl1&); // copy constructor
Impl1& operator=(const Impl1&); // assignment operator
for me.
I do not need these methods.
I do not want these methods.
I would have thought the compiler would call one of my explicit
methods since every Impl1 is also an Interface.
Is there some simple trick I am missing here?
Thanks,
J.
Can anybody shed some light on this problem?
class Interface {
public:
Interface() { ...}
virtual ~Interface() { ...}
virtual method() = 0;
};
class Impl1: public Interface {
public:
Impl1() { ...}
Impl1(const Interface&); // problem 1
virtual ~Impl1() { ... }
Impl1& operator=(const Interface&); // problem 2
};
The problem is that the compiler insists on generating the following
methods:
Impl1(const Impl1&); // copy constructor
Impl1& operator=(const Impl1&); // assignment operator
for me.
I do not need these methods.
I do not want these methods.
I would have thought the compiler would call one of my explicit
methods since every Impl1 is also an Interface.
Is there some simple trick I am missing here?
Thanks,
J.