View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003610ITKpublic2006-08-15 01:512010-10-26 15:07
ReporterChristoph Palm 
Assigned Tokentwilliams 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0003610: casting problem (run-time vs. compile-time)
Descriptionin itkCannyLevelsetFunction.txx:

  // Only cast if we need to
  if ( typeid(TImageType) == typeid(TFeatureImageType))
    {
    m_Canny->SetInput(tempFeature);
    }
  else
    {
    m_Caster->SetInput(tempFeature);
    m_Canny->SetInput(m_Caster->GetOutput());
    }

Cannot be compiled with
TImageType != TFeatureImageType,
because the compiler
stops with an error message like
"casting not possible" in m_Canny->SetInput(tempFeature);
Obviously, at run-time there is no problem because of the
if-statement, but at compile-time, the compiler does not
know, that this casting problem never will occure.

Luis Ibanez proposed the following solution:

"We should add a MetaProgramming boolean check here in order to make
those lines conditional. That is, we should replace the "if" statement
with a Template expression that is equivalent to a boolean check."
Additional InformationGerrit topic http://review.source.kitware.com/#change,240 [^] implements solution.
TagsNo tags attached.
Resolution Date
Sprint
Sprint Statusbacklog
Attached Files

 Relationships

  Notes
(0022591)
Hans Johnson (developer)
2010-10-21 12:17

This is still an issue.
(0022592)
Hans Johnson (developer)
2010-10-21 12:19

This can be solved at compile time by having a templated class with a boolean argument. See concept checking classes for a model to follow.

 Issue History
Date Modified Username Field Change
2010-10-21 12:17 Hans Johnson Assigned To Lydia Ng => Luis Ibanez
2010-10-21 12:17 Hans Johnson Note Added: 0022591
2010-10-21 12:18 Hans Johnson Assigned To Luis Ibanez => kentwilliams
2010-10-21 12:19 Hans Johnson Note Added: 0022592
2010-10-26 14:24 kentwilliams Sprint Status => backlog
2010-10-26 14:24 kentwilliams Description Updated
2010-10-26 14:24 kentwilliams Additional Information Updated
2010-10-26 15:07 kentwilliams Status assigned => closed


Copyright © 2000 - 2018 MantisBT Team