overload new and delete
Why do one need to overload operators like new and delete. And also curious to know, why do people overload ‘’ operator?
Please let me know..
new and delete are overloaded in case someone wanted to redefine the way memory was allocated. operator is overloaded for bounded arrays like a std::vector:
std::cout << a << std::endl; //prints out 3
You should be able to overload as many operators as possible so you have the flexibility to define them the way you want them to operate on your class.