Callling object constructor/destructor with a custom allocator

后端 未结 3 1648
一个人的身影
一个人的身影 2020-12-30 08:25

I have been looking into custom allocators and I quite often see them using some kind of function to allocate memory. For testing purposes and further educate my self, I tri

3条回答
  •  旧时难觅i
    2020-12-30 09:10

    To get the constructor to be called you use placement new(Note you can not override placement new). For delete and all the gotchas well the FAQ does a good job of explaining it.

提交回复
热议问题