please consider following code
#include
using namespace std;
class Digit
{
private:
int m_digit;
public:
Digit(int ndigit=0){
The pre- and post-increment are two distinct operators, and require separate overloads.
C++ doesn't allow overloading solely on return type, so having different return types as in your example wouldn't be sufficient to disambiguate the two methods.
The dummy argument is the mechanism that the designer of C++ chose for the disambiguation.