http://www.devx.com/tips/Tip/12515
class Date {
//...
public:
Date& operator++(); //prefix
Date& operator--(); //prefix
Date operator++(int unused); //postfix
Date operator--(int unused); //postfix
};
More Related Contents:
- What are the basic rules and idioms for operator overloading?
- Operator[][] overload
- How to properly overload the
- Overloading member access operators ->, .*
- Why override operator()?
- What’s the right way to overload operator== for a class hierarchy?
- Why istream object can be used as a bool expression?
- overloading new/delete
- Why should the assignment operator return a reference to the object?
- Why cannot a non-member function be used for overloading the assignment operator?
- How to overload the operator++ in two different ways for postfix a++ and prefix ++a?
- Calling a const function rather than its non-const version
- Rationale of enforcing some operators to be members
- return value of operator overloading in C++
- Is there actually a reason why overloaded && and || don’t short circuit?
- Using the less than comparison operator for strings
- C++ overloading array operator
- How to overload unary minus operator in C++?
- ‘friend’ functions and
- How do we declare a friend function with a class template into .h file and define them into a .cpp file (not all in one header file)?
- How do I call the original “operator new” if I have overloaded it?
- Operator overload which permits capturing with rvalue but not assigning to
- C++ why the assignment operator should return a const ref in order to avoid (a=b)=c
- How can I use a custom type as key for a map in C++?
- Why default three-way operator (spaceship ) generates equality operator (==) and user define three-way operator not?
- operator
- How can it be useful to overload the “function call” operator?
- Why we need to return reference to istream/ostream while overloading >> and
- Namespaces and Operator Overloading in C++
- using declaration in variadic template