[Insight-users] Errors with templates with gcc 4.1.3

Anja Ende anja.ende at googlemail.com
Mon Feb 25 06:34:49 EST 2008


Thank you!!

On 25/02/2008, J.S.Wijnhout at lumc.nl <J.S.Wijnhout at lumc.nl> wrote:
>
>  Hi,
>
>
>
> You probably have to use the "typename" keyword:
>
> typedef typename itk::VTKImageExport<ImageType>::Pointer
> ExportFilterPointer;
>
> I'm not sure, but many of my template errors go away after inserting the
> typename keyword at the appropriately place. What is appropriate depends on
> the compiler though.
>
>
>
> best,
>
> Jeroen
>
>
>  ------------------------------
>
> *From:* insight-users-bounces+j.s.wijnhout=lumc.nl at itk.org [mailto:
> insight-users-bounces+j.s.wijnhout=lumc.nl at itk.org] *On Behalf Of *Anja
> Ende
> *Sent:* Monday, February 25, 2008 11:12 AM
> *To:* insight-users at itk.org
> *Subject:* [Insight-users] Errors with templates with gcc 4.1.3
>
>
>
> Hi everyone,
>
> I am having problems with compiling the following bit of code:
>
> Say I have a class declaration as follows:
>
> class ITK2VTK
> {
> public:
>                 template<typename T>
>                 void Test()
>                 {
>                     typedef itk::Image<T, 3> ImageType;
>                     typedef itk::VTKImageExport<ImageType>
> ExportFilterType;
>                     // The following line gives the error.
>                     typedef itk::VTKImageExport<ImageType>::Pointer
> ExportFilterPointer;
>
>                     ExportFilterType::Pointer ExportFilterPointer;
>                     ExportFilterPointer itkExporter =
> ExportFilterType::New();
>                 }
> };
>
> The line:  typedef itk::VTKImageExport<ImageType>::Pointer
> ExportFilterPointer; fails with the following error:
>
> error: too few template-parameter-lists
>
> Doing a search on the Internet yielded people with the same problems but
> with static class members. However, I do not have any static definitions
> here...
>
> Anyone has any idea what is happening here?
>
> Cheers,
>
> Anja
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>


-- 
Cheers,

Anja
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20080225/15369071/attachment.html


More information about the Insight-users mailing list