Chapter 14: Ad Hoc Polymorphism-Operator Overloading

 < Day Day Up > 



Learning Objectives

  • Define the term Ad Hoc Polymorphism

  • Explain how to achieve ad hoc polymorphic behavior through operator overloading

  • Identify which C++ operators can be overloaded

  • Demonstrate your ability to overload the following arithmetic operators: +, -, *, /

  • Demonstrate your ability to overload the following relational operators: <, >, <=, >=

  • Demonstrate you ability to overload the following equality operators: ==, !=

  • Demonstrate your ability to overload the following unary operators: prefix ++, postfix ++, prefix --, postfix --

  • Demonstrate your ability to overload the subscript operator: []

  • Demonstrate your ability to overload iostream operators

  • Explain when and how to use friend functions to implement operator overloading

  • Explain when overloaded operator functions should be class members

  • Explain why and when operator overloading is right for your design



 < Day Day Up > 



C++ for Artists. The Art, Philosophy, and Science of Object-Oriented Programming
C++ For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
ISBN: 1932504028
EAN: 2147483647
Year: 2003
Pages: 340
Authors: Rick Miller

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net