我用这个模板读了类似的问题。
我没有模板,但我有同样的错误。这是我第一次重载<
我有三个文件。主文件,.h文件和.cpp文件。 Team类使用了我实现的另一个类,但我不认为这个错误是由这个类引起的。我认为我错了超载<
这是我的.h文件:
#include "Calciatore.h"
#include
class Team{
list calciatori;
string nome;
int punti;
public:
Team();
Team(string, int);
Team(list, string, int);
void set_calciatori(list);
list get_calciatori();
void set_calciatore(Calciatore*, int);
Calciatore* get_calciatore(int);
void set_nome(string);
string get_nome() const;
void set_punti(int);
int get_punti() const;
void add_calciatore(Calciatore*);
bool operator
bool operator>(Team const&);
std::ostream& operator<
private:
void set_calciatori();
};这是我的.cpp文件:
#inclu