I am studying the C++ compilation process. By reading this SO post I have started to dig deeper. First, the preprocessor does its work and it resolves all of the preprocessor directives. On my g++ implementation (GNU), #import <iostream>
is expanded to over 18k lines of source code.
However, the aforementioned post jumps to explain the process of syntactic validation of C++, i.e. the compiling stage, which translates the pure C++ code to the architecture-dependent assembly language.
However, before this translation step, I still see many templated definitions. Is there a step, prior to the translation to assembly, in where all of the templates are instantiated?
I know I can instruct g++ to only execute the preprocessing (-E option), but can I then instruct g++ to take the pure C++ file, without any preprocessing directives and generate a C++ file with all of the templates resolved?