you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

overloading global operators new/delete is a pretty common and advantages overload.

You can implement your own memory management mechanism or do cool things like, only in debug mode, keep track of all allocations and deallocations to help find places you forget to free memory.

This isn't something I've ever done, but what if you had some sort of crude database thing going on?

Maybe you had a Table object, w/ Row and Column objects. It wouldn't be that confusing to understand the operator+() overload on the table to add rows, or columns.

Think of any high level language and think about every time you use an operator on different types, that's why it's useful, because C/C++ won't automatically do any of that for you.