[Insight-users] Borland 6 Build error : Template Metaprogramming
Luis Ibanez
luis.ibanez@kitware.com
Sat, 23 Nov 2002 11:43:04 -0500
Hi John,
BTW you may also find interesting the following short article
on Template-Metaprogramming available on the Borland web site:
http://community.borland.com/article/print/0,1772,10526,00.html
with the very suggestive title
"How to torment your compiler"
Luis
=============================================
John Biddiscombe wrote:
> In a spare moment trying to get ITK built with BCB6 I ran into this error
>
> D:\Insight\Code\Numerics\FEM\itkFEMSolver.cxx:
> Error E2316 D:\Insight\Code\Common\itkImageRegion.txx 177:
> 'ImageRegion<VImageDimension>::Slice(const unsigned long) const'
> is not a member of 'ImageRegion<VImageDimension>'
>
> I can only assume a compiler glitch, but can anyone suggest a workaround or
> reason why this error is being thrown up. The code in question is below, it
> doesn't like the declaration (There are many more very similar errors so
> finding a workaround would help no end.)
>
> JB
>
> template<unsigned int VImageDimension>
> typename ImageRegion<VImageDimension>::SliceRegion
> ImageRegion<VImageDimension>
> ::Slice(const unsigned long dim) const
> {
> Index<SliceDimension> sliceIndex;
> Size<SliceDimension> sliceSize;
>
> unsigned int ii = 0;
> for (unsigned int i=0; i < VImageDimension; i++)
> {
> if (i != dim)
> {
> sliceIndex[ii] = m_Index[i];
> sliceSize[ii] = m_Size[i];
> ++ii;
> }
> }
>
> return ImageRegion<SliceDimension>(sliceIndex, sliceSize);
> }
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>
>