C++: Overloading Arithmetic & Relational Operators

C++ 20    |    Expert
  • 13 Videos | 1h 45m 49s
  • Includes Assessment
  • Earns a Badge
Some of the most commonly overloaded operators include binary arithmetic operators, used in operations such as a + b; compound assignment operat+B30ors of the form a+= b; and the prefix and postfix operators of the form a++. In this course, discover how to overload binary arithmetic operators appropriately, so that they support correct semantics in chaining. Learn how to overload compound assignment operators, such as +=. Explore how the C++ compiler differentiates between the pre and post increment operators and how these operators work in various edge cases. When you complete this course, you will be able to confidently leverage std_rel_ops by overloading relational operators.

WHAT YOU WILL LEARN

  • discover the key concepts covered in this course
    use std::rel_ops and implement comparison operators
    reuse code by invoking operators from other operators
    use the std::rel_ops namespace to have C++ generate operator overloads
    overload the + operator
    use the overloaded + operator
    recognize requirements for + operator overloads
  • perform operator overloading of the += operator
    use the += operator and attempt to return a value type
    recognize requirements for += operator overloads
    overload the pre and post increment operators
    use an overloaded ++ operator
    summarize the key concepts covered in this course

IN THIS COURSE

  • Playable
    1. 
    Course Overview
    2m 3s
    UP NEXT
  • Playable
    2. 
    Using std::rel_ops
    7m 49s
  • Locked
    3. 
    Invoking Operators from Other Operators
    8m 51s
  • Locked
    4. 
    Generating Operator Overloads using std::rel_ops
    11m 24s
  • Locked
    5. 
    Overloading the + Operator
    9m 2s
  • Locked
    6. 
    Using the Overloaded + Operator
    5m 39s
  • Locked
    7. 
    Identifying Requirements for + Operator Overloads
    11m 20s
  • Locked
    8. 
    Overloading the += Operator
    8m 46s
  • Locked
    9. 
    Using the Overloaded += Operator
    8m 8s
  • Locked
    10. 
    Identifying Requirements for += Operator Overloads
    9m 11s
  • Locked
    11. 
    Overloading the Pre and Post Increment Operators
    9m 38s
  • Locked
    12. 
    Using the Overloaded ++ Operator
    10m 7s
  • Locked
    13. 
    Course Summary
    3m 53s

EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE

Skillsoft is providing you the opportunity to earn a digital badge upon successful completion of this course, which can be shared on any social network or business platform

Digital badges are yours to keep, forever.