I think that is slightly orthogonal. The example you point to is not strictly PIMPL. So it shouldn’t’ really be affected by this.
Independently, in your example it’s not clear to me what benefit you get by allocating std::vector
on stack. It’s contents are most certainly not on stack. Hence, you could adopt PIMPL there and then std::unique_ptr
approach proposed here would work just fine. Note, you don’t have to. The proposal here is not to require PIMPL, but come up with a standard practice should one choose to do so in their VTK classes.