I am looking at a piece of code that overloads an operator, the example I have compiles and works fine, however I don't quite understand it
When I get to the implementation I can follow it again. It's the declaration I am have trouble with.Code://definition date operator+( const date & lhs, int rhs ); bool operator==(const date &, const date &); //this I don't get //implementation date operator+( int lhs, const date & rhs ) { return rhs + lhs; } bool operator==(const date & lhs, const date & rhs) { return lhs.compare(rhs) == 0; }I follow, butCode:const date & lhsI don't. I was expecting a name like lhs to be present??Code:const date &
Any explaination would be appreciated