August 2012
Intermediate to advanced
976 pages
30h 17m
English
To illustrate the increment and decrement operators, we’ll define these operators for our StrBlobPtr class (§ 12.1.6, p. 474):
class StrBlobPtr {public: // increment and decrement StrBlobPtr& operator++(); // prefix operators StrBlobPtr& operator--(); // other members as before};
Best Practices
To be consistent with the built-in operators, the prefix operators should return a reference to the incremented or decremented object.
The increment and decrement operators work similarly to each other—they call check to verify that the StrBlobPtr is still valid. If so, check also verifies ...
Read now
Unlock full access