[Insight-developers] Borland/VS issues with new checkins

Bradley Lowekamp blowekamp at mail.nih.gov
Wed Aug 5 09:14:37 EDT 2009


Is this case different since this is not a member function?

Actually there was still a discussion about whether these methods  
should be part of a class or just namespace functions. I think.

Brad


On Aug 5, 2009, at 2:56 AM, Tom Vercauteren wrote:

> Hi Luis,
>
> Thanks for this information. I guess the same rule applies to the
> templated rounding functions we were discussing a few days ago:
> http://www.itk.org/mailman/private/insight-developers/2009-July/013121.html
>
> This means that this code
>
> template <typename TReturn, typename TInput>
> inline TReturn Round(TInput x) { [snip] }
>
> will not compile on VS60, right? But then, is the following
> alternative usable on these compilers?
>
> template <typename TReturn, typename TInput>
> inline TReturn Round(TInput x, TReturn * = 0) { [snip] }
>
> Tom
>
> On Wed, Aug 5, 2009 at 00:10, Luis Ibanez<luis.ibanez at kitware.com>  
> wrote:
>>
>> Bill, Gaetan,
>>
>>
>> Thanks for the help.
>>
>> Looking closer at the VS60 with Sophie, we think we identified that
>>
>>
>> VS60 will only manage to compile templated methods if:
>>
>>
>>       A) The template parameter is part of
>>           the method arguments
>>
>> and
>>
>>      B) The method is implemented in the header
>>           file instead of the txx file.
>>
>>
>> We have modified the TemplatedGenerateData() method accordingly.
>> It now takes as argument an Accessor, that it most cases, doesn't use
>> for anything. This argument only serves the purpose of resolving the
>> instantiation of the templated method.
>>
>> This matches the pattern that we have in:
>>
>>        ImageBase::TransformPhysicalPointToIndex
>>
>> Namely:
>>
>> Templated class
>> Templated method
>> Method takes arguments whose type depend on the method template  
>> parameter
>> Method is implemented in the header (not the .txx) file.
>>
>> With this changes, the code compiles on Visual Studio 6.0.
>>
>> Still remains to be seen if the same construct will work on  
>> Borland....
>>
>>
>>        Luis
>>
>>
>> -------------------------------------------------------------------------------
>> On Tue, Aug 4, 2009 at 5:04 PM, Bill Lorensen <bill.lorensen at gmail.com 
>> >
>> wrote:
>>>
>>> Gaëtan,
>>>
>>> That is certainly better than the macro code I proposed. Where is it
>>> used in the toolkit?
>>>
>>> Bill
>>>
>>> 2009/8/4 Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr>:
>>>>
>>>> I've proposed a fix for that problem some time ago, by using  
>>>> templated
>>>> functions instead of templated methods.
>>>>
>>>> It is implemented for the UniqueLabelMapFilters:
>>>>
>>>>
>>>> http://voxel.jouy.inra.fr/darcs/contrib-itk/binaryAttributeMorphology/itkLabelMapUtilities.txx
>>>>
>>>> http://voxel.jouy.inra.fr/darcs/contrib-itk/binaryAttributeMorphology/itkShapeUniqueLabelMapFilter.txx
>>>>
>>>> I didn't have a chance to test it with msvc6, but similar code is  
>>>> used
>>>> elsewhere in the toolkit, so I guess that it should work without  
>>>> (too
>>>> much)
>>>> problem.
>>>>
>>>> Gaëtan
>>>>
>>>> Le 4 août 09 à 20:36, Bill Lorensen a écrit :
>>>>
>>>>> Let me know if you find a solution that works both for Borland and
>>>>> VS6. I think mine does.
>>>>>
>>>>> Bill
>>>>>
>>>>> On Tue, Aug 4, 2009 at 2:31 PM, Sophie Chen<sophie.chen at kitware.com 
>>>>> >
>>>>> wrote:
>>>>>>
>>>>>> Hi Bill,
>>>>>> I was just able to meet up with Luis to talk about this  
>>>>>> problem. He
>>>>>> seems
>>>>>> to
>>>>>> have some ideas how to fix the issue on VS6, but we have not  
>>>>>> tested
>>>>>> this
>>>>>> yet. We are meeting up again in an hour or so to try this on a  
>>>>>> machine
>>>>>> with
>>>>>> the VS6 build with these problems.
>>>>>> Thanks.
>>>>>>
>>>>>> On Tue, Aug 4, 2009 at 9:39 AM, Bill Lorensen
>>>>>> <bill.lorensen at gmail.com>
>>>>>> wrote:
>>>>>>>
>>>>>>> Sophie,
>>>>>>>
>>>>>>> The new classes in Review,:
>>>>>>> itkShapeKeepNObjectsLabelMapFilter
>>>>>>> itkShapeOpeningLabelMapFilter
>>>>>>> and
>>>>>>> itkShapeRelabelLabelMapFilter
>>>>>>>
>>>>>>> all have trouble compiling with the Borland and VS6 compiler.
>>>>>>>
>>>>>>> I experimented with various solution on Borland and have a  
>>>>>>> solution,
>>>>>>> although not the prettiest. I create a macro that replaces the
>>>>>>> templated function:
>>>>>>> TemplatedGenerateData. I have only tired it on
>>>>>>> itkShapeKeepNObjectsLabelMapFilter, but I'm sure it will work  
>>>>>>> on the
>>>>>>> others.
>>>>>>>
>>>>>>> Unless someone else can find better workarounds, I try to fix  
>>>>>>> the
>>>>>>> others today and check in the results.
>>>>>>>
>>>>>>> Let me know what you and Lis think about this,
>>>>>>>
>>>>>>> Bill
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Sincerely,
>>>>>>      Sophie
>>>>>>
>>>>> _______________________________________________
>>>>> Powered by www.kitware.com
>>>>>
>>>>> Visit other Kitware open-source projects at
>>>>> http://www.kitware.com/opensource/opensource.html
>>>>>
>>>>> Please keep messages on-topic and check the ITK FAQ at:
>>>>> http://www.itk.org/Wiki/ITK_FAQ
>>>>>
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://www.itk.org/mailman/listinfo/insight-developers
>>>>
>>>> --
>>>> Gaëtan Lehmann
>>>> Biologie du Développement et de la Reproduction
>>>> INRA de Jouy-en-Josas (France)
>>>> tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
>>>> http://voxel.jouy.inra.fr  http://www.itk.org
>>>> http://www.mandriva.org  http://www.bepo.fr
>>>>
>>>>
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-developers
>>
>>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers



More information about the Insight-developers mailing list