Summary

This chapter covers a number of topics that are related by one concept: to make it possible to write functions that would allow the client code to treat programmer-defined objects similarly to variables of built-in types.

We looked at unary operators, prefix and postfix increment and decrement operators that give C++ programs a nice touch. We discussed conversion operators—together with conversion constructors, they continue the C++ tendency to weaken strong typing rules in favor of greater flexibility in handling objects.

I also reviewed the subscript and function call operators—a strange breed, they do not follow the common rules of transformation from the function call syntax to the expression syntax. Unlike most C++ operators, they ...

Get Core C++ A Software Engineering Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.