according to ISO/IEC 14882:2003 chapter 13.5.7 a single int is required to distinguish between prefix and postfix operators:
Code: Select all
class X {
public:
X& operator++(); // prefix ++a
X operator++(int); // postfix a++
};
Thanks.
Moderators: david ward, misra cpp
Code: Select all
class X {
public:
X& operator++(); // prefix ++a
X operator++(int); // postfix a++
};
I am struggling with finding a good reason for the deviation as defined in chapter 4.4 of MISRA Compliance 2016.misra cpp wrote:At the moment this rule does apply to these overloads, so would require a deviation. This is under review of the next version
because it´s basically about recognizing operator overloading as defined in ISO C++ 2003.Usability (Recognizability)