3 ms·
This also significantly hurts readability, and I would hate the person who writes code like this unless you really need binary compatibility (if you do, it is a
by omegalulw 5y ago
This also significantly hurts readability, and I would hate the person who writes code like this unless you really need binary compatibility (if you do, it is a sign that you should improve your release schedule).
Mostly, you just want to decouple the interface of the class from the implementation details.
In that case do just that - define an interface and implement it elsewhere.
You can always just static link all binaries.
- maccard 5y ago> You can always just static link all binaries. Not always you can't. There are many reasons to use dynamically linked libraries all of which are applicable whether you're using PIMPL or not.
- omegalulw 5y ago> Not always you can't What's an example of this (assuming you don't care about binary size)?
- maccard 5y agoYou care about binary size is probably the first one. In my experience, increases in binary size cause an exponential increase in link time. You may have licensing restrictions (LGPL for example), or be using a binary thay was provided to you. Your source code might be set up in such a way that a monolithic build doesn't make sense.