By the way, I am using eclipse and g++ on arch linux (I ran pacman -Syu less than a week ago, so everything is up to date).
Eclipse produces an error every time I try to compile this:
#ifndef DATE_HPP_
#define DATE_HPP_
using namespace std;
class Date {
public:
int Year;
char Month;
char Day;
char HH;
char MM;
char ss;
Date();
/*
* Overloaded Operator Functions
*/
//Assignments
Date operator=(Date input);
//Comparisons
bool operator==(Date& rhs);
bool operator!=(Date& rhs);
bool operator<(Date& rhs);
bool operator>(Date& rhs);
bool operator<=(Date& rhs);
bool operator>=(Date& rhs);
//Conversion
operator char*();
operator std::string();
ostream& operator<<(ostream& os, const Date& date); //TROUBLE LINE
};
#endif /* DATE_HPP_ */
Eclipse shows a message on the operator<< declaration saying it must only have a single argument. Yet, when I declare it like this:
ostream& operator<<(const Date& date);
It complains that it must have two. What am I doing wrong?