August 2013
Beginner
540 pages
12h 51m
English
After completing this chapter, you will be able to:
Describe what operator overloading is.
Decide which classes should support operator overloading.
Recognize what you can and can’t overload.
Describe guidelines for providing overloaded operators.
Explain how to implement operator overloads.
You’ve already seen how to construct classes and structures, provide member functions in your types, and use these functions in applications. In this chapter, you’re going to find out about a special category of member functions called overloaded operator functions, with which you can add extra functionality so that your types can be used more naturally and intuitively.
If you’ve encountered operator overloading in C++ before, ...