G
Guest
I've just started writing managed C++ (VS 2005 Beta 2) and I really have not
read a whole lot about the differences between managed and unmanaged C++.
Using the class wizard, I can create a managed class defined like:
ref class MyClass {
public
MyClass(void);
~MyClas(void);
};
I'd like to know whether I should add copy and assignment constructors. The
standard syntax of
MyClass(const MyClass&);
MyClass& operator=(const MyClass&);
doesn't work. (compiler error C3699). Do I replace & with ^ ? I would think
that there's times when the default copy constructor will be insufficient.
Part of my confusion stems from my inability to understand the difference
between new and gcnew. When would I want to use one as opposed to the other?
Thanks for any pointers (no pun intended).
read a whole lot about the differences between managed and unmanaged C++.
Using the class wizard, I can create a managed class defined like:
ref class MyClass {
public
MyClass(void);
~MyClas(void);
};
I'd like to know whether I should add copy and assignment constructors. The
standard syntax of
MyClass(const MyClass&);
MyClass& operator=(const MyClass&);
doesn't work. (compiler error C3699). Do I replace & with ^ ? I would think
that there's times when the default copy constructor will be insufficient.
Part of my confusion stems from my inability to understand the difference
between new and gcnew. When would I want to use one as opposed to the other?
Thanks for any pointers (no pun intended).