M
ma740988
Section 6.5 of Josuttis, C++ Templates states - and I paraphrase.
"Let's assume for the sake of argument that every file to be compiled
starts with the same N lines of code. We could compile these N lines
and save the complete state of the compiler at that point in a so-
called precompiled header. Then, for every file in our program, we
could reload the saved state and start compilation at line N+1."
Josuttis, went on to state that "In practice this measn the files must
start with the same #include directives, which consume a substantial
portion of our build time".
So given a file called 'std.hpp'. For discussion purposes assume
std.hpp contains the following.
# include <iostream>
# include <string>
# include <vector>
# include <deque>
# include <list>
Later: foo.cpp
# include "std.hpp"
template < typename T >
void confused ( const std::vector < T >& bogus ) {
// stuff
} // end confused
At issue: How can I 'save the complete state of the compiler" such
that any / all changes made to confused wont result in re-compilation
of std.hpp?
"Let's assume for the sake of argument that every file to be compiled
starts with the same N lines of code. We could compile these N lines
and save the complete state of the compiler at that point in a so-
called precompiled header. Then, for every file in our program, we
could reload the saved state and start compilation at line N+1."
Josuttis, went on to state that "In practice this measn the files must
start with the same #include directives, which consume a substantial
portion of our build time".
So given a file called 'std.hpp'. For discussion purposes assume
std.hpp contains the following.
# include <iostream>
# include <string>
# include <vector>
# include <deque>
# include <list>
Later: foo.cpp
# include "std.hpp"
template < typename T >
void confused ( const std::vector < T >& bogus ) {
// stuff
} // end confused
At issue: How can I 'save the complete state of the compiler" such
that any / all changes made to confused wont result in re-compilation
of std.hpp?