diff --git a/Modules/Core/Common/include/itkVariableLengthVector.h b/Modules/Core/Common/include/itkVariableLengthVector.h index bf4d709131a..636a83e048b 100644 --- a/Modules/Core/Common/include/itkVariableLengthVector.h +++ b/Modules/Core/Common/include/itkVariableLengthVector.h @@ -20,9 +20,9 @@ #include #include +#include #include "itkNumericTraits.h" #include "itkMetaProgrammingLibrary.h" -#include "itkEnableIf.h" #include "itkIsBaseOf.h" #include "itkIsNumber.h" #include "itkPromoteType.h" @@ -1052,7 +1052,7 @@ struct GetType * \sa \c VariableLengthVectorExpression */ template -inline typename mpl::EnableIf, mpl::IsArray>, unsigned int>::Type +inline std::enable_if_t, mpl::IsArray>::Value, unsigned int> GetSize(TExpr1 const & lhs, TExpr2 const & rhs) { (void)rhs; @@ -1071,7 +1071,7 @@ GetSize(TExpr1 const & lhs, TExpr2 const & rhs) * \sa \c VariableLengthVectorExpression */ template -inline typename mpl::EnableIf, mpl::Not>>, unsigned int>::Type +inline std::enable_if_t, mpl::Not>>::Value, unsigned int> GetSize(TExpr1 const & lhs, TExpr2 const & itkNotUsed(rhs)) { return lhs.Size(); @@ -1087,7 +1087,7 @@ GetSize(TExpr1 const & lhs, TExpr2 const & itkNotUsed(rhs)) * \sa \c VariableLengthVectorExpression */ template -inline typename mpl::EnableIf, mpl::Not>>, unsigned int>::Type +inline std::enable_if_t, mpl::Not>>::Value, unsigned int> GetSize(TExpr1 const & itkNotUsed(lhs), TExpr2 const & rhs) { return rhs.Size(); @@ -1261,8 +1261,8 @@ struct VariableLengthVectorExpression * \sa \c mpl::IsArray<> to know the exact array types recognized as \em array by this traits */ template -inline typename mpl::EnableIf, - VariableLengthVectorExpression>::Type +inline std::enable_if_t::Value, + VariableLengthVectorExpression> operator+(TExpr1 const & lhs, TExpr2 const & rhs) { return VariableLengthVectorExpression(lhs, rhs); @@ -1278,8 +1278,8 @@ operator+(TExpr1 const & lhs, TExpr2 const & rhs) * \sa \c mpl::IsArray<> to know the exact array types recognized as \em array by this traits */ template -inline typename mpl::EnableIf, - VariableLengthVectorExpression>::Type +inline std::enable_if_t::Value, + VariableLengthVectorExpression> operator-(TExpr1 const & lhs, TExpr2 const & rhs) { return VariableLengthVectorExpression(lhs, rhs); @@ -1294,8 +1294,8 @@ operator-(TExpr1 const & lhs, TExpr2 const & rhs) * \sa \c mpl::IsArray<> to know the exact array types recognized as \em array by this traits */ template -inline typename mpl::EnableIf, - VariableLengthVectorExpression>::Type +inline std::enable_if_t::Value, + VariableLengthVectorExpression> operator*(TExpr1 const & lhs, TExpr2 const & rhs) { return VariableLengthVectorExpression(lhs, rhs); @@ -1309,8 +1309,8 @@ operator*(TExpr1 const & lhs, TExpr2 const & rhs) * \sa \c mpl::IsArray<> to know the exact array types recognized as \em array by this traits */ template -inline typename mpl::EnableIf, - VariableLengthVectorExpression>::Type +inline std::enable_if_t::Value, + VariableLengthVectorExpression> operator/(TExpr1 const & lhs, TExpr2 const & rhs) { return VariableLengthVectorExpression(lhs, rhs); @@ -1341,7 +1341,7 @@ operator<<(std::ostream & os, VariableLengthVectorExpression -inline typename mpl::EnableIf, typename TExpr::RealValueType>::Type +inline std::enable_if_t::Value, typename TExpr::RealValueType> GetNorm(TExpr const & v) { return static_cast(std::sqrt(static_cast(GetSquaredNorm(v)))); @@ -1353,7 +1353,7 @@ GetNorm(TExpr const & v) * \relates itk::VariableLengthVectorExpression */ template -inline typename mpl::EnableIf, typename TExpr::RealValueType>::Type +inline std::enable_if_t::Value, typename TExpr::RealValueType> GetSquaredNorm(TExpr const & v) { using RealValueType = typename TExpr::RealValueType; diff --git a/Modules/IO/ImageBase/include/itkConvertPixelBuffer.h b/Modules/IO/ImageBase/include/itkConvertPixelBuffer.h index 168fc4b652e..5e41f17fd57 100644 --- a/Modules/IO/ImageBase/include/itkConvertPixelBuffer.h +++ b/Modules/IO/ImageBase/include/itkConvertPixelBuffer.h @@ -21,7 +21,7 @@ #include "itkObject.h" #include "itkNumericTraits.h" -#include "itkEnableIf.h" +#include // for enable_if namespace itk { @@ -167,11 +167,11 @@ class ITK_TEMPLATE_EXPORT ConvertPixelBuffer * world of rgb or rgb alpha would have to be 1.0 */ template - static typename DisableIfC::IsInteger, UComponentType>::Type + static std::enable_if_t::IsInteger, UComponentType> DefaultAlphaValue(); template - static typename EnableIfC::IsInteger, UComponentType>::Type + static std::enable_if_t::IsInteger, UComponentType> DefaultAlphaValue(); }; } // namespace itk diff --git a/Modules/IO/ImageBase/include/itkConvertPixelBuffer.hxx b/Modules/IO/ImageBase/include/itkConvertPixelBuffer.hxx index 2cd8e323b93..33b0d447893 100644 --- a/Modules/IO/ImageBase/include/itkConvertPixelBuffer.hxx +++ b/Modules/IO/ImageBase/include/itkConvertPixelBuffer.hxx @@ -29,7 +29,7 @@ namespace itk template template -typename DisableIfC::IsInteger, UComponentType>::Type +std::enable_if_t::IsInteger, UComponentType> ConvertPixelBuffer::DefaultAlphaValue() { return NumericTraits::One; @@ -37,7 +37,7 @@ ConvertPixelBuffer::Defaul template template -typename EnableIfC::IsInteger, UComponentType>::Type +std::enable_if_t::IsInteger, UComponentType> ConvertPixelBuffer::DefaultAlphaValue() { return NumericTraits::max(); diff --git a/Modules/IO/NIFTI/test/itkNiftiImageIOTest3.cxx b/Modules/IO/NIFTI/test/itkNiftiImageIOTest3.cxx index b903108038e..bc97473dc47 100644 --- a/Modules/IO/NIFTI/test/itkNiftiImageIOTest3.cxx +++ b/Modules/IO/NIFTI/test/itkNiftiImageIOTest3.cxx @@ -17,13 +17,12 @@ *=========================================================================*/ #include "itkNiftiImageIOTest.h" -#include "itkEnableIf.h" +#include // for enable_if #include template void -Decrement(ScalarType & value, - typename itk::DisableIfC::is_signed, ScalarType>::Type * = nullptr) +Decrement(ScalarType & value, std::enable_if_t::is_signed, ScalarType> * = nullptr) { if (value > 1) { @@ -33,8 +32,7 @@ Decrement(ScalarType & value, template void -Decrement(ScalarType & value, - typename itk::EnableIfC::is_signed, ScalarType>::Type * = nullptr) +Decrement(ScalarType & value, std::enable_if_t::is_signed, ScalarType> * = nullptr) { if (value > -std::numeric_limits::max() + 1) {