M
mathieu
Hi there,
I am currently struggling with a compiler error on a templated code.
The error is complete non-sense. I think the issue here is that I am
including files in a loop. To handle templates I usually have 3 types
of files:
- .h : interface + inline function
- .cxx : implementation (no templates)
- .txx: implementation of templates (with #if blocker to prevent
multiple inclusion)
The problem is that I often struggle : when to include those txx
files ? As a rule of thumb I try to include them only once in some
central .cxx file. I have been searching the C++ FAQ for such rules of
thumbs. Are any good practices to follow, I have been browsing through
the STL of gcc and they manage to implement everything in the
interface file.
I can reproduce the issue with gcc 3.x / gcc 4.x and visual studio
2005 and they all give different errors...but on the same line
Thanks,
-Mathieu
For reference here is the gcc 3.x error:
/home/mmalaterre/Projects/gdcm/trunk/Source/
DataStructureAndEncodingDefinition/gdcmItem.h:149: error: expected
primary-expression before '>' token
http://gdcm.svn.sourceforge.net/vie...DataStructureAndEncodingDefinition/gdcmItem.h
I am currently struggling with a compiler error on a templated code.
The error is complete non-sense. I think the issue here is that I am
including files in a loop. To handle templates I usually have 3 types
of files:
- .h : interface + inline function
- .cxx : implementation (no templates)
- .txx: implementation of templates (with #if blocker to prevent
multiple inclusion)
The problem is that I often struggle : when to include those txx
files ? As a rule of thumb I try to include them only once in some
central .cxx file. I have been searching the C++ FAQ for such rules of
thumbs. Are any good practices to follow, I have been browsing through
the STL of gcc and they manage to implement everything in the
interface file.
I can reproduce the issue with gcc 3.x / gcc 4.x and visual studio
2005 and they all give different errors...but on the same line
Thanks,
-Mathieu
For reference here is the gcc 3.x error:
/home/mmalaterre/Projects/gdcm/trunk/Source/
DataStructureAndEncodingDefinition/gdcmItem.h:149: error: expected
primary-expression before '>' token
http://gdcm.svn.sourceforge.net/vie...DataStructureAndEncodingDefinition/gdcmItem.h