r/cpp • u/victor-s8n • 29d ago
How I design C++ classes
https://rafb.eu/blog/cpp-class-design/This is my first ever blog-post, any feedback is welcome! ofc, no AI got used.
66
Upvotes
r/cpp • u/victor-s8n • 29d ago
This is my first ever blog-post, any feedback is welcome! ofc, no AI got used.
View all comments
Show parent comment
9
u/pavel_v 28d ago
You don't need to introduce runtime performance when using some forms of PIMPL. We've used something like the below one and as far as I've checked the assembly in few of our use cases, it completely disappears and there is no indirection introduced. Of course, there is a tradeoff - there is no ABI stability in this case. If the requested
SizeorAlignmentchanges this will cause/need recompilation.