I have a pool manager template class I when the class object is added back to the pool manager, I want to reset the state. I would like to call placment destroyer and placment constructor, so next time the pool manager gets reset to give it to it. I have tried many ways to work, but I have been stumped. Here is an example of what I have tried.
template & lt; Class T & gt; Zero pool class & lt; T & gt; :: ReleaseTool (T * Obj) {obj-> ~ T (); // Call Destroyer obj-> T: T (); // Call Constructor // also tried new (obj) T () / / But it does not appear to add a pointer to the // indicator in my list of available objects for reuse or to work again}
I have different syntax Tried a bunch and did not seem to do any work. Code is a cross platform, so compile using GCC (under Mingav or Linux or Mac) and for windows I am currently using 2003 vs.
How about:
template & lt; Class T & gt; Zero pool class & lt; T & gt; :: ReleaseTool (T * Obj) {obj-> ~ T (); // Call Destructor obj = New ((* Zero *) obj) T (); // Call Constructor // Add Object to List in Object ...}
Comments
Post a Comment