Overloaded 'operator++' must be a unary or binary operator (has 3 parameters)
You declared the operators outside the class as non-class functions
Fraction& operator ++ (Fraction);
Fraction operator++(Fraction, int);
however then you are trying to define them like class member functions
Fraction& Fraction::operator ++ (Fraction){
// Increment prefix
m_top += m_bottom;
return *this;
}
Fraction Fraction::operator ++ (Fraction, int){
//Increment postfix
}
Either declare them as class member functions the following way
class Fraction
{
public:
Fraction & operator ++();
Fraction operator ++( int );
//...
And in this case the definition for example of the preincrement operator can look like
Fraction & Fraction::operator ++(){
// Increment prefix
m_top += m_bottom;
return *this;
}
Or declare them as non-class function that are friends of the class because they need to have access to private data members of the class
class Fraction
{
public:
friend Fraction & operator ++( Fraction & );
friend Fraction operator ++( Fraction &, int );
//...
And in this case the definition for example of the preincrement operator can look like
Fraction & operator ++( Fraction &f ){
// Increment prefix
f.m_top += f.m_bottom;
return f;
}