Transfer from https://www.jianshu.com/p/b52a5df69c88
c ++ new operator in the corresponding constructor is usually complete assignment of memory and the two calls. I ask you: 1) how to make the new operator does not allocate memory, just call the constructor? 2) such use what's the use? |
placement new is mainly applied to:
In time very demanding applications, because these programs are assigned to the determined time; long running program without being interrupted; and performing a garbage collector (garbage collector).