This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
2. Define macro NO_TEMPLATE_INSTANTIATION during normal compilation and
un-define it when g++ is called by collect2,
and making this accessible via some new compiler option (e.g. - frepo2)?
Why would this be good?
1. Code in foo.cpp normally compiles without including big_header.h (from bar.tpp). This makes it impossible for foo.cpp to become inadvertently dependant on the code from big_header.h.
2. Compilation of foo.cpp and every source file that includes bar.h is much faster since the implementation of bar.tpp is not seen by the compiler.
3. Definitions for the bar class template and the big_header are only compiled by collect2 during template instantiations. If bar<int> is commonly used in the code, compilation times would be significantly reduced.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |