The C++ standard library contains many templates, and many new standard header names to access those templates. The Sun C++ standard library puts declarations in the template headers, and implementation of the templates in separate files. If one of your project file names matches the name of a new template header, it is possible to pick up the wrong implementation file, and cause numerous, bizarre errors. Suppose you have your own template called vector, putting the implementation in a file called vector.cc. Depending on file locations and command-line options, it is possible for the compiler to pick up your vector.cc when it needs the one from the standard library, or vice-versa. When the export keyword and exported templates are implemented in a future compiler version, the situation will be worse.
There are two recommendations for preventing current and future problems:
Do not use any of the standard header names as names of your template files. All of the standard library is in namespace std, so you won't get direct name conflicts with your own templates or classes. You can still get indirect conflicts from using declarations or directives, so it is preferable not to duplicate template names from the standard library. The standard headers involving templates are as follows:
algorithm bitset complex deque exception fstream functional iomanip ios iosfwd iostream istream iterator limits list locale map memory numeric ostream queue set sstream stack stdexcept streambuf string typeinfo utility valarray vector
Put template implementations in the header (.h) file, instead of in a separate file, to prevent implementation file name conflicts. See C++ Users' Guide for more information.