C++ 에서의 new는 2가지 동작을 한다
1. 메모리를 할당한다
2. 생성자를 호출한다.
delete 또한 마찬가지
1. 소멸자 호출
2. 메모리 해제
// within any block scope...
{
// Statically allocate the storage with automatic storage duration
// which is large enough for any object of type “T”.
alignas(T) unsigned char buf[sizeof(T)];
T* tptr = new(buf) T; // Construct a “T” object, placing it directly into your
// pre-allocated storage at memory address “buf”.
tptr->~T(); // You must **manually** call the object's destructor
// if its side effects is depended by the program.
} // Leaving this block scope automatically deallocates “buf”.