[Insight-developers] Deriving from templates
   
    Bradley Wyman
     
    bwyman@insightful.com
       
    Wed, 24 Apr 2002 17:41:54 -0700
    
    
  
I have some code that inherits from a templated class as in:
template <class TInputImage, class TOutputImage, class ResamplerType>
class ITK_EXPORT BSplineUpsampleImageFilter :=20
    public ResamplerType
{
  ...
This works fine under VC++ but does not compile on Linux.  On Linux the
compiler throws errors elsewhere in the code such as:
parse error before `=3D'
on the seemingly unrelated line (in the txx file):
InputImagePointer  inputPtr =3D const_cast< TInputImage * > (
this->GetInput().GetPointer() );
Has anybody had experience compiling this type of templated code on
Linux?  When I hard code the "public ResamplerType" line all compiles
and works.  Since I have 4 ResamplerTypes I would prefer not to hard
code this as it would result in 4 nearly identical routines.
Suggestions are welcomed.
_____________________________________________
Brad Wyman, Ph.D.=A0        Insightful Corp.
1700 Westlake Ave. N=A0=A0=A0=A0=A0=A0(206)802-2256
Seattle, WA 98109=A0=A0=A0=A0     Fax: (206)283-6310=20
bwyman@insightful.com=20