placement new | what is need of same | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

placement new | what is need of same

Hi Refer below code (would appreciate any improvement if you can suggest if any) where I tried to implement placement new: https://code.sololearn.com/c6nHkVF5JiSi Time in normal new operation is consuming more time than what is taken by placement new. My query is do we need to go for this placement new or move constructor (temp object creation on push_back argument) on vector is sufficient? Thanks a lot...

18th Jun 2020, 9:46 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
3 Answers
+ 1
Okay... Any specific reason to do so ?
18th Jun 2020, 10:11 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
18th Jun 2020, 10:14 AM
Anthony Maina
Anthony Maina - avatar
0
It's used for allocating memory in a specific region defined by a programmer,otherwise known as an Arena
18th Jun 2020, 10:09 AM
Anthony Maina
Anthony Maina - avatar