B
Bart Simpson
I have a class that has a member that is a const reference:
class MyClass
{
public:
MyClass(const AnotherClass& ac);
MyClass(const MyClass& mc);
//....
private:
const AnotherClass &m_reference ;
};
How do I implement the copy constructor? (I get compilation erros with
this):
MyClass::MyClass(const MyClass& mc)
:m_reference(mc.m_reference)
{
//..
Copy();
}
Compiler error: Error error C3646: 'm_reference' : unknown override
specifier
class MyClass
{
public:
MyClass(const AnotherClass& ac);
MyClass(const MyClass& mc);
//....
private:
const AnotherClass &m_reference ;
};
How do I implement the copy constructor? (I get compilation erros with
this):
MyClass::MyClass(const MyClass& mc)
:m_reference(mc.m_reference)
{
//..
Copy();
}
Compiler error: Error error C3646: 'm_reference' : unknown override
specifier