Im having trouble with the operator +. I'm trying to overload it so it can be used with one of my classes but it doesnt seem to work when i do this:
I keep getting this error:Code:var1= var2+ var3;
C:\Code\Projects\MyLib\main.cpp:9: error: no match for 'operator=' in 'result = (&string1)->CBuffer:perator+(((CBuffer&)(&string2)))
Heres my definitions for the overloads:
The only solution i could think of was changing the + overload to:Code:CBuffer& operator=(CBuffer& pBuffer); CBuffer operator+(CBuffer& pOther);
But that required a static return object...not sure if thats the best way around it.Code:CBuffer& operator+(CBuffer& pOther);