[Insight-developers] Deriving from templates

Luis Ibanez luis.ibanez@kitware.com
Wed, 24 Apr 2002 21:08:49 -0400


Hi Bradley,

Deriving form a template is ok.

There should be a problem somewhere else.
a typical suspect is a "typename" missing.

...but from your description of a single error
line is hard to say.

Could you please post the entire error output
from the compiler.

BTW we have  a IRC channel open now
if you want to join. That could go faster that
email exchange.

the channel is :    #itk-developers

Thanks

Luis

===============================

Bradley Wyman wrote:

>I have some code that inherits from a templated class as in:
>
>template <class TInputImage, class TOutputImage, class ResamplerType>
>class ITK_EXPORT BSplineUpsampleImageFilter : 
>    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 `='
>
>on the seemingly unrelated line (in the txx file):
>InputImagePointer  inputPtr = 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.         Insightful Corp.
>1700 Westlake Ave. N      (206)802-2256
>Seattle, WA 98109         Fax: (206)283-6310 
>bwyman@insightful.com 
>_______________________________________________
>Insight-developers mailing list
>Insight-developers@public.kitware.com
>http://public.kitware.com/mailman/listinfo/insight-developers
>