24 Jul
2006
24 Jul
'06
7:49 a.m.
Is it possible to manually call the constructor of an object. It is possible to call the destructor (a trick i found from std::vector<T>::pop_back()) I stepped through the std::vector<T>::push_back() to find how they call the constructor for memory that has already been allocated, but I could not follow the code. Test3 t; t.~Test3(); // OK t.Test3(); // compile error