I’ve been digging through the source code of an API and I noticed lack of usage of initialization lists, which was instead moved to the constructor body. I thought this is suboptimal but then noticed that those constructors are inline.
So is there some limitation when using initialization lists with inline constructors?
10x
No, there’s no limitation, initialization lists can be used same as before.
Also, I doubt there’s any performance loss. Inline constructors means that the compiler can better optimize the code, since it’s visible to all translation units that use that class.
From a coding-style point of view, they should have used initialization lists.