Thursday, October 28, 2010

Header Files

The C Standard specifies which standard header files include other standard header files; The C++ standard doesn't do the same thing.

This can cause portability issues. A typical issue is when a free operator+() is declared outside of the namespace that its associated class is defined, you may or may not get very long template error messages depending what standard C++ include files are included in other standard C++ include files.

Reference: Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions by Herb Sutter. Addison-Wesley, 1999, p. 137.

No comments:

Post a Comment