A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://timsong-cpp.github.io/cppwp/n4659/over.inc below:

[over.inc]

The user-defined function called operator++ implements the prefix and postfix ++ operator. If this function is a non-static member function with no parameters, or a non-member function with one parameter, it defines the prefix increment operator ++ for objects of that type. If the function is a non-static member function with one parameter (which shall be of type int) or a non-member function with two parameters (the second of which shall be of type int), it defines the postfix increment operator ++ for objects of that type. When the postfix increment is called as a result of using the ++ operator, the int argument will have value zero.134 [Example:

struct X {
  X&   operator++();              X    operator++(int);         };

struct Y { };
Y&   operator++(Y&);            Y    operator++(Y&, int);       
void f(X a, Y b) {
  ++a;                            a++;                            ++b;                            b++;                          
  a.operator++();                 a.operator++(0);                operator++(b);                  operator++(b, 0);             }

end example]

The prefix and postfix decrement operators -- are handled analogously.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4