I've been looking at C++ build times with Xcode. The Apple STL library for basic_string auto-instantiates basic_string for 5 types into all files that include it. I'm trying to use alternate STL libraries like EASTL and FASTL which have their own string types, but have to mix in the following types where there are holes.
1. <mutex>, <condition_variable>, <thread> include <system_error> which includes <string>
2. <random> includes <string>.
So these slow the build even if header are precompiled, but creates 5x versions of basic_string in char, char8_t, char16_t, char32_t, and wchar_t flavors into every file that happens to include this even indirectly through the headers above. I only use
string and basic_string<char>
with utf8 data anyhow. I don't need the other 4 types.
How can this be improved?