5 ms·
Destination-Passing Style
- sakras 3y agoI've actually been thinking along similar lines lately but for a different problem: I see a lot of people using the "pimpl" pattern - having an interface heap-allocate an object for you to hide implementation details. With this destination-passing style you could get rid of the heap allocation and potentially have the "impl" object live on the caller's stack.