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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access