宿題プロジェクトの << 演算子をオーバーロードしようとしています。エラー コード 4430 型指定子がありません - int が想定されます。注: C++ はデフォルトインをサポートしていません。どんな助けでも素晴らしいでしょう!
//EmployeeInfo is designed to hold employee ID information
#ifndef EMPLOYEEINFO_H
#define EMPLOYEEINFO_H
#include <iostream>
#include <ostream>
using namespace std;
std::ostream &operator << (std::ostream &, const EmployeeInfo &);
class EmployeeInfo
{
private:
int empID;
string empName;
public:
//Constructor
EmployeeInfo();
//Member Functions
void setName(string);
void setID(int);
void setEmp(int, string);
int getId();
string getName();
string getEmp(int &);
//operator overloading
bool operator < (const EmployeeInfo &);
bool operator > (const EmployeeInfo &);
bool operator == (const EmployeeInfo &);
friend std::ostream &operator << (std::ostream &, const EmployeeInfo &);
};
friend std::ostream operator<<(std::ostream &strm, const EmployeeInfo &right)
{
strm << right.empID << "\t" << right.empName;
return strm;
}
#endif