Hi all. First time poster here (I think)
I’ve got a (hopefully) quick question: can you declare a copy constructor in a class that is derived from UObject? I’m certainly not able to. Visual studio tells me that the “member function already defined or declared, see declaration of …”. I read somewhere that you should use FORCEINLINE before declaration and definition, but in my experience it doesn’t change anything.
Here is an example that i found on stackoverflow on how you would normally do it :
class Base
{
protected:
int m_nValue;
public:
Base(int nValue)
: m_nValue(nValue)
{
}
const char* GetName() { return "Base"; }
int GetValue() { return m_nValue; }
};
class Derived: public Base
{
public:
Derived(int nValue)
: Base(nValue)
{
}
Derived( const Derived &d ){
std::cout << "copy constructor
";
}
const char* GetName() { return "Derived"; }
int GetValueDoubled() { return m_nValue * 2; }
};