Looking at a template metaprogram (TMP), are the C ++ compilers building data that instantly Count the numbers? Or is there any other way to get this number automatically? For example an important initiative
#include & lt; Iostream & gt; Template & lt; Int N & gt; Structure fact {enum {value = N * fact} N-1 & gt; :: value}; }; The template's & lt; & Gt; Structure fact & lt; 1 & gt; {Enum {value = 1}; }; Int main () {const int x = fact & lt; 3 & gt; :: Values; Std :: cout & lt; & Lt; X & LT; & Lt; "\ N"; Return 0; } I want to withdraw 3 numbers (because the fact is <3>, the fact> <2>, and the fact <1> instantly) This example if you are trivial, but whenever you start using the example Boost. MPL, compilation time has actually exploded, and I would like to know how many of them are due to the immediate hiding class. My question is mainly for Visual C ++, but the answer of the GCC will also be appreciated.
Edit : Stephen T. From my current very cynical view of Visual C ++. Lavevez / D1 reports make a grep + word count on the avalclayout and output file, but it increases the compilation in time (A) and (b) RezX is difficult to get 100% right.
I have created a GCC which prints it in the name of each class template, because it immediately To get the same for function templates, you can already call C + + Front-end cc1plus without the -quiet flag. I have not found that he is yet to change to a proper GCC option, this is just one hack on my own source tree, I am thinking of implementing this as a plugin instead I'm not near the top of my todo list.
Comments
Post a Comment