3 ms·
Valid point. However, there's no reason it has to be overly manual. As an example, you can make all the global object classes mixins for a variadic and use a
by shortoncash 10y ago
Valid point.
However, there's no reason it has to be overly manual. As an example, you can make all the global object classes mixins for a variadic and use a variadic constructor and member methods to bring them all online in one fell swoop, even parameterizing construction via policy classes as template parameters. (Plus you have the added benefit of knowing via sizeof() on the variadic type the footprint of all the global objects.)
The gain would be to avoid the dependence on the linker script solution, particularly if tweaking linker scripts on a different compiler/build environments.