[Insight-users] Any known template depth limitations with GCC 3.2?

Parag Chandra pchandra@radonc.unc.edu
Thu, 10 Apr 2003 15:15:40 -0400


This is a multi-part message in MIME format.

------=_NextPart_000_00EE_01C2FF74.0C142050
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

I've derived a class from itkProcessObject that compiles just fine under =
MS VisualC++ 6. However, I'm getting a strange error from GCC on RedHat =
8.0 that claims the prototype for a method I've defined in my .txx file =
does not match the declaration in my .h file, even though the two are =
identical according to the compiler:

/mnt/development/aks/Code/Processing/aksContourIntersectionFilter.cxx:68:=
 protot
ype
   for `TInputImage::PixelType
   =
aks::ContourIntersectionFilter<TInputImage>::DetermineCrossedContour(cons=
t
   itk::ContinuousIndex<aks::ImageToPointSetFilter<TInputImage,
   aks::PointsOfInterestSet<double, 2, 5, aks::POIMeshTraits<double, 2, =
5, 2,
   double, double, double> > =
>::OutputPointSetType::PointType::CoordRepType,
   aks::ContourIntersectionFilter<TInputImage>::InputImageDimension>&)' =
does
   not match any in class `aks::ContourIntersectionFilter<TInputImage>'
/mnt/development/aks/Code/Processing/aksContourIntersectionFilter.h:107: =
candida
te
    is: TInputImage::PixelType
   =
aks::ContourIntersectionFilter<TInputImage>::DetermineCrossedContour(cons=
t
   itk::ContinuousIndex<aks::ImageToPointSetFilter<TInputImage,
   aks::PointsOfInterestSet<double, 2, 5, aks::POIMeshTraits<double, 2, =
5, 2,
   double, double, double> > =
>::OutputPointSetType::PointType::CoordRepType,
   aks::ContourIntersectionFilter<TInputImage>::InputImageDimension>&)

I cut and pasted the candidate and the prototype as reported above, and =
they are identical. In my code, they appear as:

InputImagePixelType DetermineCrossedContour(const ContinuousIndexType =
&index);

in the header, and as:

template <class TInputImage>
typename ContourIntersectionFilter<TInputImage>::InputImagePixelType=20
ContourIntersectionFilter<TInputImage>
::DetermineCrossedContour(const ContinuousIndexType &index)

in the source, where InputImagePixelType and ContinuousIndexType are =
defined as follows:

    typedef typename itk::ContinuousIndex<OutputCoordRepType, =
InputImageDimension>=20
        ContinuousIndexType;
    typedef typename InputImageType::PixelType InputImagePixelType;

If I simply change the definition of ContinuousIndexType to:

    typedef typename itk::ContinuousIndex<double, 2> =
ContinuousIndexType;

then the code compiles fine with GCC. Does anyone know what might be =
causing this? It seems like I'm running up against some ceiling on =
template depth.

Thanks.

-Parag Chandra


------=_NextPart_000_00EE_01C2FF74.0C142050
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1141" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I've derived a class from =
itkProcessObject that=20
compiles just fine under MS VisualC++ 6. However, I'm getting a strange =
error=20
from GCC on RedHat 8.0 that claims the prototype for a method I've =
defined in my=20
.txx file does not match the declaration in my .h file, even though the =
two are=20
identical according to the compiler:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>/mnt/development/aks/Code/Processing/aksContourIntersectionFilte=
r.cxx:68:=20
protot<BR>ype<BR>&nbsp;&nbsp; for =
`TInputImage::PixelType<BR>&nbsp;&nbsp;=20
aks::ContourIntersectionFilter&lt;TInputImage&gt;::DetermineCrossedContou=
r(const<BR>&nbsp;&nbsp;=20
itk::ContinuousIndex&lt;aks::ImageToPointSetFilter&lt;TInputImage,<BR>&nb=
sp;&nbsp;=20
aks::PointsOfInterestSet&lt;double, 2, 5, aks::POIMeshTraits&lt;double, =
2, 5,=20
2,<BR>&nbsp;&nbsp; double, double, double&gt; &gt;=20
&gt;::OutputPointSetType::PointType::CoordRepType,<BR>&nbsp;&nbsp;=20
aks::ContourIntersectionFilter&lt;TInputImage&gt;::InputImageDimension&gt=
;&amp;)'=20
does<BR>&nbsp;&nbsp; not match any in class=20
`aks::ContourIntersectionFilter&lt;TInputImage&gt;'<BR>/mnt/development/a=
ks/Code/Processing/aksContourIntersectionFilter.h:107:=20
candida<BR>te<BR>&nbsp;&nbsp;&nbsp; is: =
TInputImage::PixelType<BR>&nbsp;&nbsp;=20
aks::ContourIntersectionFilter&lt;TInputImage&gt;::DetermineCrossedContou=
r(const<BR>&nbsp;&nbsp;=20
itk::ContinuousIndex&lt;aks::ImageToPointSetFilter&lt;TInputImage,<BR>&nb=
sp;&nbsp;=20
aks::PointsOfInterestSet&lt;double, 2, 5, aks::POIMeshTraits&lt;double, =
2, 5,=20
2,<BR>&nbsp;&nbsp; double, double, double&gt; &gt;=20
&gt;::OutputPointSetType::PointType::CoordRepType,<BR>&nbsp;&nbsp;=20
aks::ContourIntersectionFilter&lt;TInputImage&gt;::InputImageDimension&gt=
;&amp;)<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I cut and pasted the candidate and the =
prototype as=20
reported above, and they are identical. In my code, they appear =
as:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>InputImagePixelType =
DetermineCrossedContour(const=20
ContinuousIndexType &amp;index);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>in the header, and as:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>template &lt;class =
TInputImage&gt;<BR>typename=20
ContourIntersectionFilter&lt;TInputImage&gt;::InputImagePixelType=20
<BR>ContourIntersectionFilter&lt;TInputImage&gt;<BR>::DetermineCrossedCon=
tour(const=20
ContinuousIndexType &amp;index)<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>in the source, where =
InputImagePixelType and=20
ContinuousIndexType are defined as follows:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; typedef typename=20
itk::ContinuousIndex&lt;OutputCoordRepType, InputImageDimension&gt;=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
ContinuousIndexType;<BR></FONT><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;=20
typedef typename InputImageType::PixelType =
InputImagePixelType;<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>If I simply change the definition of=20
ContinuousIndexType to:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; typedef typename=20
itk::ContinuousIndex&lt;double, 2&gt; ContinuousIndexType;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>then the code compiles fine with GCC. =
Does anyone=20
know what might be causing this? It seems like I'm running up against =
some=20
ceiling on template depth.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>-Parag Chandra</DIV>
<DIV><BR></DIV></FONT></BODY></HTML>

------=_NextPart_000_00EE_01C2FF74.0C142050--