On Mon 23 Aug 2004, William A. Hoffman wrote:
> Nice idea, but once you add .txx as a c++ source file the folder it
> is in does not matter, it will be compiled.
This is going somewhat off the topic, but a .txx file is not compiled
by default. (At least, it isn't with VC6 and VC7.) You have to
explicitly make the compiler think that .txx are compilable. I think
it may involve registry settings.
> I agree it is a bad thing to do, but I was a bit surprised to see
> the emulation stuff as part of the project.
Given your statement, you are probably aware of all this, but I'll
If you, or anyone else, has changed the compiler to treat .txx as a
compilable file, you've probably done the wrong thing unless the
compiler happens to support exported templates. To my knowledge, only
the Comeau (sp?) compiler does this. Even then, your exported template
implementation then should sit in a .cxx file.
Besides, convention has .txx files containing the implementation of a
template. It should not contain any code that causes the template to
be instantiated. This is why is it okay to include your .txx file at
the end of the corresponding .h file if you are going to use implicit
"Compiling" a .txx file should not cause any object code to be
generated. Of course, it will cause symbols to be defined, and in the
specific case of vcl, these symbols could conflict with the correct
system symbols. So there, the correct solution is indeed to never
"see" those files.