Hi All,
Suppose I have a class of my own, CVCEditBox and I overload a few operators
like this:
class CVCEditBox : public CStatic
{
....
CVCEditBox operator+ (const CVCEditBox& TheString) const;
...
}
And then, the implementation of this operator would be:
CVCEditBox CVCEditBox::operator+(const CVCEditBox& TheString) const
{
return CVCEditBox((CString) SomeString);
}
By the way, I do have an argument constructor that takes a CString..
The question is, is there any problem if I do the overloading this way ?
[returning the constructor of the object] It seems to work but I am
wondering if I should do it differently (maybe a more efficient way .. it
seems to me that returning the constructor rathern than a combination of
*this / CVCEditBox& uses more memory since it does a copy/create a new
object ?!]
Thanks in advance,
Marius