Pimpl idiom without using dynamic memory allocation

后端 未结 7 1326
独厮守ぢ
独厮守ぢ 2020-12-12 21:00

we want to use pimpl idiom for certain parts of our project. These parts of the project also happen to be parts where dynamic memory allocation is forbidden and this decisio

7条回答
  •  失恋的感觉
    2020-12-12 21:26

    pimpl bases on pointers and you can set them to any place where your objects are allocated. This can also be a static table of objects declared in the cpp file. The main point of pimpl is to keep the interfaces stable and hide the implementation (and its used types).

提交回复
热议问题