I get this error while trying to create a copy assignment constructor: "overloaded operator must be a binary operator"
this is my code: header:
class User{
public:
User(const std::string& name);
const User& operator=(const User &other);
//virtual Watchable* getRecommendation(Session& s) = 0;
std::string getName() const;
std::vector<Watchable*> get_history() const;
protected:
std::vector<Watchable*> history;
private:
const std::string name;
};
cpp:
User::User(const std::string& name):name(name) {
}
const User& operator=(const User &other){
}
the error is in the cpp file. anyone?