6.8 Summary

Ru-Brd

  • Templates challenge the classic compiler-plus-linker model. Therefore there are different approaches to organize template code: the inclusion model, explicit instantiation, and the separation model.

  • Usually, you should use the inclusion model (that is, put all template code in header files).

  • By separating template code into different header files for declarations and definitions, you can more easily switch between the inclusion model and explicit instantiation.

  • The C++ standard defines a separate compilation model for templates (using the keyword export ). It is not yet widely available, however.

  • Debugging code with templates can be challenging.

  • Template instances may have very long names .

  • To take advantage of precompiled headers, be sure to keep the same order for #include directives.

Ru-Brd


C++ Templates
C++ Templates: The Complete Guide
ISBN: 0201734842
EAN: 2147483647
Year: 2002
Pages: 185

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net