Here are a few of the many examples of operator overloading:
- myString + yourString might concatenate two std::string
objects
- myDate++ might increment a Date object
- a * b might multiply two Number objects
- a[i] might access an element of an Array object
- x = *p might dereference a "smart pointer" that "points" to
a disk record — it could seek to the location on disk where p "points" and
return the appropriate record into x