Jump to content
  • Advertisement
Sign in to follow this  

Templates what "phase" of compilation

This topic is 1524 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Three related questions


Is template "resolution" done by the preprocessor or the compiler or a third entity?

If the "resolution" is done by the compiler its still done in a separate pass before actual compilation right?

Is there a special name for the phase where templates get "resolved"?


Oh and when i say "resolved" is there a better term, "instantiated" maybe?


Thanks in advance for any help.


Share this post

Link to post
Share on other sites
Experimentally, it seems to me like this is the pipeline (at least for MSVC):

- Preprocessor runs
- Compiler begins running through each translation unit
- As things requiring a template instantiation are traversed, templates are instantiated, potentially generating errors

This is easy to confirm by putting a template declaration prior to a syntax error and compiling, then moving the syntax error to ahead of the template and recompiling. The order of emitted errors seems to support my theory.

This is purely speculation, of course.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!