|
|
|
|
|
by jchb
2774 days ago
|
|
> Not sure why we need to exclude pointers? Sometimes you need to. You cannot entirely stack allocate an object that uses PIMPL. Also you cannot allocate an array of such objects compactly in memory. On the other hand, if you want to be able to evolve the class member variables but still maintain a stable ABI, you need to hide the memory layout, for example with PIMPL.
But this is a C++ limitation. For example Objective-C* (and also soon Swift) allows modifying the class layout, adding properties etc, without changing the ABI. https://en.wikipedia.org/wiki/Objective-C#Non-fragile_instan... |
|
You actually can, if I'm not misunderstanding: http://www.gotw.ca/gotw/028.htm