I have a project that uses quite a lot of meta-programming of C ++ templates. This reduces compilation time. I understand that I cannot have a cake and have it, but I would like to know some tips and advice on how to reduce compilation time. I have already tried explicit instances, and although this can help in some cases, many times, instances are unique to a particular compilation unit, in which case explicit instance creation does not help anything. And now we are only talking about Klang, which does a very good job. When I try this on g ++, compilation time just explodes. For one file, I gave up, waiting for it to compile after 45 minutes.
- Are there any common criminals when it comes to metaprogramming patterns, which is often problematic? What methods should be avoided and what should I do instead?
- Are there any areas where GCC is known to be worse than Clang, and is there a way around this?
I use mostly simple vanilla C ++ 11 technologies, I do not use Boost MPL or similar libraries.
source share