overloading new operator in c++

Posted by Angus on Stack Overflow See other posts from Stack Overflow or by Angus
Published on 2013-10-21T03:49:17Z Indexed on 2013/10/21 3:53 UTC
Read the original article Hit count: 156

Filed under:

I have a code for best fit algorithm. I want to try to use the best fit algorithm using the operator new.

Every time I create an object I should give it from the already allocated memory say,

1]20 2]12 3]15 4]6 5]23 respectively. which ever minimum amount fits to the objects size(eg.21)

I wanted to do it for different object types, so I need to write the overloaded operator new to be common functionality for all the class objects.

Can I do it through friend functions, or is there any possible way to do it.

© Stack Overflow or respective owner

Related posts about c++