O'Reilly logo

Beyond the C++ Standard Library: An Introduction to Boost by Björn Karlsson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Library 4. Operators

How Does the Operators Library Improve Your Programs?

• Provides a complete set of comparison operators

• Provides a complete set of arithmetic operators

• Provides a complete set of operators for iterators

Among the operators defined in C++, there are a number of related sets. When you encounter a class with one operator from one of these sets, you typically expect to find the others, too. For instance, when a class provides operator==, you expect to find operator!= and probably operator<, operator<=, operator>, and operator>=. Sometimes, a class only provides operator< in order to define an ordering so objects of that class can be used in associative containers, but that often leaves class users wanting more. Likewise, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required