The main problem with Unity Builds, as they are called, is that they disrupt C ++.
In C ++, the source file, including the pre-processed one, is called the translation unit. Some private characters for this translation unit:
- declared namespace-level
static characters - everything declared in an anonymous namespace
If you combine several files in C ++, the compiler will share these personal characters between all files that are combined together, since from his point of view it has become a single translation module.
You will get an error if two local classes suddenly have the same name and idem for constants. Annoying like hell, but at least you are notified.
For functions, however, it may break silently due to overload . When, before the compiler, select static void launch(short u); for your launch(1) call, it will suddenly move to static void launch(int i, Target t = "Irak"); . Oups?
Unity builds are dangerous. What you are looking for is called WPO (Optimization of the entire program) or LTO (Optimization of communication time), check out the internal documents of your compiler to find out how to activate it.
source share