Nota
L-aċċess għal din il-paġna jeħtieġ l-awtorizzazzjoni. Tista’ tipprova tidħol jew tibdel id-direttorji.
L-aċċess għal din il-paġna jeħtieġ l-awtorizzazzjoni. Tista’ tipprova tibdel id-direttorji.
no postfix form of 'operator ++' found for type 'type', using prefix form
Remarks
There is no postfix increment operator defined for the given type. The compiler used the overloaded prefix operator.
Example
This warning can be avoided by defining a postfix ++ operator. Create a two-argument version of the ++ operator as shown here:
// C4620.cpp
// compile with: /W1
class A
{
public:
A(int nData) : m_nData(nData)
{
}
A operator++()
{
m_nData -= 1;
return *this;
}
// A operator++(int)
// {
// A tmp = *this;
// m_nData -= 1;
// return tmp;
// }
private:
int m_nData;
};
int main()
{
A a(10);
++a;
a++; // C4620
}