Hello,
I have abstract class:
#include <string>
using namespace std;
class AString
{
public:
virtual ~AString() {}
virtual const string& GetName() const = 0;
virtual const string& GetValue() const = 0;
virtual const int GetSize() const = 0;
};
And derivative class. I try to overload binary + in this class:
class SymbString : public AString
{
private:
string name;
string val;
public:
SymbString() {}
SymbString(string _name) : name(_name) {}
SymbString(string _name, string _val) : name(_name), val(_val) {}
const string& GetName() const { return name; }
const string& GetValue() const { return val; }
const int GetSize() const { return val.size (); }
const string& SetValue(string value)
{
val = value;
return val;
}
SymbString operator + (const SymbString &str1, const SymbString &str2)
{
}
};
But see error: SymbString operator + (const SymbString &str1, const SymbString &str2) must take either zero or one argument
What's wrong?
Thank you.