25 #include "itkSmartPointer.h"
38 template <
typename T2,
typename T1>
39 inline itk::SmartPointer<T2>
DynamicCast(
const itk::SmartPointer<T1>& p1)
41 return typename itk::SmartPointer<T2>(
dynamic_cast<typename itk::SmartPointer<T2>::ObjectType*
>(p1.GetPointer()));
54 template <
typename T2,
typename T1>
55 inline itk::SmartPointer<const T2>
ConstCast(
const itk::SmartPointer<T1>& p1)
57 return typename itk::SmartPointer<const T2>(
const_cast<typename itk::SmartPointer<const T2>::ObjectType*
>(p1.GetPointer()));
72 template <
typename T2,
typename T1>
73 inline itk::SmartPointer<T2>
ConstCast(
const itk::SmartPointer<const T1>& p1)
75 return typename itk::SmartPointer<T2>(
const_cast<typename itk::SmartPointer<T2>::ObjectType*
>(p1.GetPointer()));