Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Modules/Core/Common/include/itkAutoPointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ namespace itk
* to another AutoPointer when the assignement operator is used.
* An AutoPointer can release ownership of the object it holds.
*
* This class follows the design of the std::auto_ptr class. The main
* reason for not using the std version is to avoid templated methods,
* which greatly increase the difficulty of wrapping for Tcl, Python
* and Java.
* This class follows the design of the std::unique_ptr (auto_ptr being
* deprecated in C++11) class. The main * reason for not using the std
* version is to avoid templated methods, which greatly increase the
* difficulty of wrapping for Tcl, Python and Java.
*
* \ingroup ITKSystemObjects
* \ingroup DataAccess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ class ITK_TEMPLATE_EXPORT AutoPointerDataObjectDecorator:public DataObject
typedef SmartPointer< const Self > ConstPointer;

/** Typedef for the component type (object being decorated) */
typedef T ComponentType;
typedef std::auto_ptr< T > ComponentPointer;
typedef T ComponentType;
typedef std::unique_ptr< T > ComponentPointer;

/** Method for creation through the object factory. */
itkNewMacro(Self);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ AutoPointerDataObjectDecorator< T >
{
// store the pointer and take ownership of the memory
ComponentPointer aPointer(val);
m_Component = aPointer;
m_Component = std::move(aPointer);
this->Modified();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class ITK_TEMPLATE_EXPORT ConstShapedNeighborhoodIterator:
ConstIterator m_ConstBeginIterator;
private:
/** Copy constructor */
ConstShapedNeighborhoodIterator(const ConstShapedNeighborhoodIterator &) ITK_DELETED_FUNCTION;
ConstShapedNeighborhoodIterator(const ConstShapedNeighborhoodIterator &) = delete;
};
} // namespace itk

Expand Down
6 changes: 3 additions & 3 deletions Modules/Core/Common/include/itkHexahedronCell.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ HexahedronCell< TCellInterface >
double *dist2,
InterpolationWeightType *weight)
{
static ITK_CONSTEXPR_VAR int ITK_HEX_MAX_ITERATION = 10;
static ITK_CONSTEXPR_VAR double ITK_HEX_CONVERGED = 1.e-03;
static ITK_CONSTEXPR_VAR double ITK_DIVERGED = 1.e6;
static constexpr int ITK_HEX_MAX_ITERATION = 10;
static constexpr double ITK_HEX_CONVERGED = 1.e-03;
static constexpr double ITK_DIVERGED = 1.e6;

int iteration, converged;
double params[3];
Expand Down
1 change: 0 additions & 1 deletion Modules/Core/Common/include/itkImageAlgorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ struct ImageAlgorithm
/** Unary functor just for static_cast operator */
template<typename TInputType, typename TOutputType>
struct StaticCast
: public std::unary_function<TInputType,TOutputType>
{
TOutputType operator() (const TInputType i) { return static_cast<TOutputType>(i); }
};
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkIsBaseOf.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace mpl {
template <typename TBase, typename TDerived>
struct IsBaseOf
{
static ITK_CONSTEXPR_VAR bool Value
static constexpr bool Value
= IsConvertible<const TDerived*, const TBase*>::Value
&& ! IsSame<const TBase*, const void*>::Value;
};
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkIsConvertible.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct IsConvertible
static TTwo Test(...);
static TFrom MakeT();
public:
static ITK_CONSTEXPR_VAR bool Value = sizeof(Test(MakeT())) == sizeof(TOne);
static constexpr bool Value = sizeof(Test(MakeT())) == sizeof(TOne);
};

} // end namespace mpl
Expand Down
8 changes: 4 additions & 4 deletions Modules/Core/Common/include/itkMacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,12 @@ namespace itk
//-*-*-*


#if ITK_COMPILER_CXX_CONSTEXPR
#if defined ( ITK_FUTURE_LEGACY_REMOVE )
#define ITK_CONSTEXPR_FUNC constexpr
#define ITK_CONSTEXPR_VAR constexpr
#else
#define ITK_CONSTEXPR_FUNC inline
#define ITK_CONSTEXPR_VAR const
#define ITK_CONSTEXPR_FUNC "Replace ITK_CONSTEXPR_FUNC with constexpr"
#define ITK_CONSTEXPR_VAR "Replace ITK_CONSTEXPR_VAR with constexpr"
#endif

// Use "ITK_FALLTHROUGH;" to annotate deliberate fall-through in switches,
Expand Down Expand Up @@ -792,7 +792,7 @@ TTarget itkDynamicCastInDebugMode(TSource x)
#if defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__ ) < 405 && !defined( __clang__ ) && !defined( __INTEL_COMPILER )
# define itkStaticConstMacro(name,type,value) enum { name = value }
#else
# define itkStaticConstMacro(name,type,value) static ITK_CONSTEXPR_VAR type name = value
# define itkStaticConstMacro(name,type,value) static constexpr type name = value
#endif

#define itkGetStaticConstMacro(name) (Self::name)
Expand Down
60 changes: 30 additions & 30 deletions Modules/Core/Common/include/itkMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,52 +53,52 @@ namespace Math


/** \brief \f[e\f] The base of the natural logarithm or Euler's number */
static ITK_CONSTEXPR_VAR double e = vnl_math::e;
static constexpr double e = vnl_math::e;
/** \brief \f[ \log_2 e \f] */
static ITK_CONSTEXPR_VAR double log2e = vnl_math::log2e;
static constexpr double log2e = vnl_math::log2e;
/** \brief \f[ \log_{10} e \f] */
static ITK_CONSTEXPR_VAR double log10e = vnl_math::log10e;
static constexpr double log10e = vnl_math::log10e;
/** \brief \f[ \log_e 2 \f] */
static ITK_CONSTEXPR_VAR double ln2 = vnl_math::ln2;
static constexpr double ln2 = vnl_math::ln2;
/** \brief \f[ \log_e 10 \f] */
static ITK_CONSTEXPR_VAR double ln10 = vnl_math::ln10;
static constexpr double ln10 = vnl_math::ln10;
/** \brief \f[ \pi \f] */
static ITK_CONSTEXPR_VAR double pi = vnl_math::pi;
static constexpr double pi = vnl_math::pi;
/** \brief \f[ 2\pi \f] */
static ITK_CONSTEXPR_VAR double twopi = vnl_math::twopi;
static constexpr double twopi = vnl_math::twopi;
/** \brief \f[ \frac{\pi}{2} \f] */
static ITK_CONSTEXPR_VAR double pi_over_2 = vnl_math::pi_over_2;
static constexpr double pi_over_2 = vnl_math::pi_over_2;
/** \brief \f[ \frac{\pi}{4} \f] */
static ITK_CONSTEXPR_VAR double pi_over_4 = vnl_math::pi_over_4;
static constexpr double pi_over_4 = vnl_math::pi_over_4;
/** \brief \f[ \frac{\pi}{180} \f] */
static ITK_CONSTEXPR_VAR double pi_over_180 = vnl_math::pi_over_180;
static constexpr double pi_over_180 = vnl_math::pi_over_180;
/** \brief \f[ \frac{1}{\pi} \f] */
static ITK_CONSTEXPR_VAR double one_over_pi = vnl_math::one_over_pi;
static constexpr double one_over_pi = vnl_math::one_over_pi;
/** \brief \f[ \frac{2}{\pi} \f] */
static ITK_CONSTEXPR_VAR double two_over_pi = vnl_math::two_over_pi;
static constexpr double two_over_pi = vnl_math::two_over_pi;
/** \brief \f[ \frac{180}{\pi} \f] */
static ITK_CONSTEXPR_VAR double deg_per_rad = vnl_math::deg_per_rad;
static constexpr double deg_per_rad = vnl_math::deg_per_rad;
/** \brief \f[ \sqrt{2\pi} \f] */
static ITK_CONSTEXPR_VAR double sqrt2pi = vnl_math::sqrt2pi;
static constexpr double sqrt2pi = vnl_math::sqrt2pi;
/** \brief \f[ \frac{2}{\sqrt{\pi}} \f] */
static ITK_CONSTEXPR_VAR double two_over_sqrtpi = vnl_math::two_over_sqrtpi;
static constexpr double two_over_sqrtpi = vnl_math::two_over_sqrtpi;
/** \brief \f[ \frac{2}{\sqrt{2\pi}} \f] */
static ITK_CONSTEXPR_VAR double one_over_sqrt2pi = vnl_math::one_over_sqrt2pi;
static constexpr double one_over_sqrt2pi = vnl_math::one_over_sqrt2pi;
/** \brief \f[ \sqrt{2} \f] */
static ITK_CONSTEXPR_VAR double sqrt2 = vnl_math::sqrt2;
static constexpr double sqrt2 = vnl_math::sqrt2;
/** \brief \f[ \sqrt{ \frac{1}{2}} \f] */
static ITK_CONSTEXPR_VAR double sqrt1_2 = vnl_math::sqrt1_2;
static constexpr double sqrt1_2 = vnl_math::sqrt1_2;
/** \brief \f[ \sqrt{ \frac{1}{3}} \f] */
static ITK_CONSTEXPR_VAR double sqrt1_3 = vnl_math::sqrt1_3;
static constexpr double sqrt1_3 = vnl_math::sqrt1_3;
/** \brief euler constant */
static ITK_CONSTEXPR_VAR double euler = vnl_math::euler;
static constexpr double euler = vnl_math::euler;

//: IEEE double machine precision
static ITK_CONSTEXPR_VAR double eps = vnl_math::eps;
static ITK_CONSTEXPR_VAR double sqrteps = vnl_math::sqrteps;
static constexpr double eps = vnl_math::eps;
static constexpr double sqrteps = vnl_math::sqrteps;
//: IEEE single machine precision
static ITK_CONSTEXPR_VAR float float_eps = vnl_math::float_eps;
static ITK_CONSTEXPR_VAR float float_sqrteps = vnl_math::float_sqrteps;
static constexpr float float_eps = vnl_math::float_eps;
static constexpr float float_sqrteps = vnl_math::float_sqrteps;

/** A useful macro to generate a template floating point to integer
* conversion templated on the return type and using either the 32
Expand Down Expand Up @@ -507,10 +507,10 @@ struct AlmostEqualsFunctionSelector<true, false, true, false>
template<typename TInputType1, typename TInputType2>
struct AlmostEqualsScalarImplementer
{
static ITK_CONSTEXPR_VAR bool TInputType1IsInteger = itk::NumericTraits<TInputType1>::IsInteger;
static ITK_CONSTEXPR_VAR bool TInputType1IsSigned = itk::NumericTraits<TInputType1>::IsSigned;
static ITK_CONSTEXPR_VAR bool TInputType2IsInteger = itk::NumericTraits<TInputType2>::IsInteger;
static ITK_CONSTEXPR_VAR bool TInputType2IsSigned = itk::NumericTraits<TInputType2>::IsSigned;
static constexpr bool TInputType1IsInteger = itk::NumericTraits<TInputType1>::IsInteger;
static constexpr bool TInputType1IsSigned = itk::NumericTraits<TInputType1>::IsSigned;
static constexpr bool TInputType2IsInteger = itk::NumericTraits<TInputType2>::IsInteger;
static constexpr bool TInputType2IsSigned = itk::NumericTraits<TInputType2>::IsSigned;

typedef typename AlmostEqualsFunctionSelector< TInputType1IsInteger, TInputType1IsSigned,
TInputType2IsInteger, TInputType2IsSigned >::SelectedVersion SelectedVersion;
Expand Down Expand Up @@ -614,8 +614,8 @@ struct AlmostEqualsComplexChooser< true, false>
template <typename T1, typename T2>
struct AlmostEqualsComplexImplementer
{
static ITK_CONSTEXPR_VAR bool T1IsComplex = NumericTraits< T1 >::IsComplex;
static ITK_CONSTEXPR_VAR bool T2IsComplex = NumericTraits< T2 >::IsComplex;
static constexpr bool T1IsComplex = NumericTraits< T1 >::IsComplex;
static constexpr bool T2IsComplex = NumericTraits< T2 >::IsComplex;

typedef typename AlmostEqualsComplexChooser< T1IsComplex, T2IsComplex >::ChosenVersion ChosenVersion;
};
Expand Down
Loading