Help me please. I allocate memory as follows (T is template type)
T * ptr = reinterpret_cast<T*>(operator new (sizeof(T));
And after that I want to put an element into this memory; Am I write if I do it in this way?
new (p) T(elem);
(elem has type T)
UPD: sorry, it's a mistake that I forget to write operator new