From c32766df6e78c0b493970a7cb12cc34467dad9f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Mon, 14 Oct 2024 16:25:02 -0400 Subject: [PATCH] COMP: Fix the last compile error on MSVC Overloading operator + (const T & a, const T & b) is overly broad. The error message was: IRFFTCommon.cxx C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\functors\BinaryFunctors.h(189,73): error C2676: binary '/': 'std::list::,std::allocator::>>' does not define this operator or a conversion to a type acceptable to the predefined operator (compiling source file '../../../../ITKNornir/src/IRFFTCommon.cxx') C:\Dev\ITK-git\Modules\ThirdParty\VNL\src\vxl\core\vnl\vnl_matrix_fixed.h(858,25): could be 'vnl_matrix_fixed operator /(const vnl_matrix_fixed &,T)' C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\functors\BinaryFunctors.h(189,42): 'vnl_matrix_fixed operator /(const vnl_matrix_fixed &,T)': could not deduce template argument for 'const vnl_matrix_fixed &' from 'std::list::,std::allocator::>>' C:\Dev\ITK-git\Modules\ThirdParty\VNL\src\vxl\core\vnl\vnl_vector_fixed.h(608,30): or 'vnl_vector_fixed operator /(const vnl_vector_fixed &,T)' C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\functors\BinaryFunctors.h(189,42): 'vnl_vector_fixed operator /(const vnl_vector_fixed &,T)': could not deduce template argument for 'const vnl_vector_fixed &' from 'std::list::,std::allocator::>>' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\complex(1493,38): or 'std::complex<_Other> std::operator /(const std::complex<_Other> &,const std::complex<_Other> &) noexcept()' C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\functors\BinaryFunctors.h(189,42): 'std::complex<_Other> std::operator /(const std::complex<_Other> &,const std::complex<_Other> &) noexcept()': could not deduce template argument for 'const std::complex<_Other> &' from 'std::list::,std::allocator::>>' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\complex(1501,38): or 'std::complex<_Other> std::operator /(const std::complex<_Other> &,const _Ty &) noexcept()' C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\functors\BinaryFunctors.h(189,42): 'std::complex<_Other> std::operator /(const std::complex<_Other> &,const _Ty &) noexcept()': could not deduce template argument for 'const std::complex<_Other> &' from 'std::list::,std::allocator::>>' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\complex(1509,38): or 'std::complex<_Other> std::operator /(const _Ty &,const std::complex<_Other> &) noexcept()' C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\functors\BinaryFunctors.h(189,42): 'std::complex<_Other> std::operator /(const _Ty &,const std::complex<_Other> &) noexcept()': could not deduce template argument for 'const std::complex<_Other> &' from 'int' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\valarray(648,26): or 'std::valarray<_Ty> std::operator /(const std::valarray<_Ty> &,const valarray<_Ty>::value_type &)' C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\functors\BinaryFunctors.h(189,42): 'std::valarray<_Ty> std::operator /(const std::valarray<_Ty> &,const valarray<_Ty>::value_type &)': could not deduce template argument for 'const std::valarray<_Ty> &' from 'std::list::,std::allocator::>>' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\valarray(658,26): or 'std::valarray<_Ty> std::operator /(const valarray<_Ty>::value_type &,const std::valarray<_Ty> &)' C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\functors\BinaryFunctors.h(189,42): 'std::valarray<_Ty> std::operator /(const valarray<_Ty>::value_type &,const std::valarray<_Ty> &)': could not deduce template argument for 'const std::valarray<_Ty> &' from 'int' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\valarray(881,26): or 'std::valarray<_Ty> std::operator /(const std::valarray<_Ty> &,const std::valarray<_Ty> &)' C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\functors\BinaryFunctors.h(189,42): 'std::valarray<_Ty> std::operator /(const std::valarray<_Ty> &,const std::valarray<_Ty> &)': could not deduce template argument for 'const std::valarray<_Ty> &' from 'std::list::,std::allocator::>>' C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\functors\BinaryFunctors.h(189,73): the template instantiation context (the oldest one first) is M:\Dev\Nornir\ITKNornir\include\itkIRCommon.h(137,19): see reference to class template instantiation 'itk::ImageMaskSpatialObject<2,unsigned char>' being compiled C:\Dev\ITK-git\Modules\Core\SpatialObjects\include\itkImageMaskSpatialObject.h(47,59): see reference to class template instantiation 'itk::ImageSpatialObject<2,TPixel>' being compiled with [ TPixel=unsigned char ] C:\Dev\ITK-git\Modules\Core\SpatialObjects\include\itkImageSpatialObject.h(40,55): see reference to class template instantiation 'itk::SpatialObject<2>' being compiled C:\Dev\ITK-git\Modules\Core\SpatialObjects\include\itkSpatialObject.h(101,52): see reference to class template instantiation 'itk::AffineTransform::ScalarType,2>' being compiled C:\Dev\ITK-git\Modules\Core\Transform\include\itkAffineTransform.hxx(263,1): while compiling class template member function 'itk::SmartPointer> itk::AffineTransform::GetInverseTransform(void) const' with [ TParametersValueType=itk::SpatialObject<2>::ScalarType ] C:\Dev\ITK-git\Modules\Core\Transform\include\itkTransform.hxx(301,1): while compiling class template member function 'itk::DiffusionTensor3D itk::Transform::PreservationOfPrincipalDirectionDiffusionTensor3DReorientation(const itk::DiffusionTensor3D &,const vnl_matrix_fixed &) const' with [ TParametersValueType=itk::SpatialObject<2>::ScalarType ] C:\Dev\ITK-git\Modules\Core\Transform\include\itkMatrixOffsetTransformBase.hxx(268,11): see the first reference to 'itk::Transform::PreservationOfPrincipalDirectionDiffusionTensor3DReorientation' in 'itk::MatrixOffsetTransformBase::TransformDiffusionTensor3D' with [ TParametersValueType=itk::SpatialObject<2>::ScalarType ] C:\Dev\ITK-git\Modules\Core\Transform\include\itkMatrixOffsetTransformBase.hxx(290,45): see the first reference to 'itk::MatrixOffsetTransformBase::TransformDiffusionTensor3D' in 'itk::MatrixOffsetTransformBase::TransformDiffusionTensor3D' with [ TParametersValueType=itk::SpatialObject<2>::ScalarType ] C:\Dev\ITK-git\Modules\Core\Common\include\itkSymmetricSecondRankTensor.hxx(282,1): while compiling class template member function 'void itk::SymmetricSecondRankTensor::ComputeEigenAnalysis(itk::FixedArray &,itk::Matrix &) const' with [ TComponent=itk::SpatialObject<2>::ScalarType ] C:\Dev\ITK-git\Modules\Core\Common\include\itkSymmetricSecondRankTensor.hxx(283,30): see reference to class template instantiation 'itk::SymmetricEigenAnalysisFixedDimension<3,itk::Matrix,itk::FixedArray,itk::Matrix>' being compiled with [ TComponent=itk::SpatialObject<2>::ScalarType ] C:\Dev\ITK-git\Modules\Core\Common\include\itkSymmetricEigenAnalysis.h(811,3): while compiling class template member function 'unsigned int itk::SymmetricEigenAnalysisFixedDimension<3,itk::Matrix,itk::FixedArray,itk::Matrix>::ComputeEigenValuesAndVectors(const TMatrix &,TVector &,TEigenMatrix &) const' with [ TComponent=itk::SpatialObject<2>::ScalarType, TMatrix=itk::Matrix, TVector=itk::FixedArray::ScalarType,3>, TEigenMatrix=itk::Matrix ] C:\Dev\ITK-git\Modules\Core\Common\include\itkSymmetricSecondRankTensor.hxx(295,52): see the first reference to 'itk::SymmetricEigenAnalysisFixedDimension<3,itk::Matrix,itk::FixedArray,itk::Matrix>::ComputeEigenValuesAndVectors' in 'itk::SymmetricSecondRankTensor::ComputeEigenAnalysis' with [ TComponent=itk::SpatialObject<2>::ScalarType ] C:\Dev\ITK-git\Modules\Core\Transform\include\itkTransform.hxx(323,35): see the first reference to 'itk::SymmetricSecondRankTensor::ComputeEigenAnalysis' in 'itk::Transform::PreservationOfPrincipalDirectionDiffusionTensor3DReorientation' with [ TComponent=itk::SpatialObject<2>::ScalarType ] and [ TParametersValueType=itk::SpatialObject<2>::ScalarType ] C:\Dev\ITK-git\Modules\Core\Transform\include\itkMatrixOffsetTransformBase.hxx(268,11): see the first reference to 'itk::Transform::PreservationOfPrincipalDirectionDiffusionTensor3DReorientation' in 'itk::MatrixOffsetTransformBase::TransformDiffusionTensor3D' with [ TParametersValueType=itk::SpatialObject<2>::ScalarType ] C:\Dev\ITK-git\Modules\Core\Transform\include\itkMatrixOffsetTransformBase.hxx(290,45): see the first reference to 'itk::MatrixOffsetTransformBase::TransformDiffusionTensor3D' in 'itk::MatrixOffsetTransformBase::TransformDiffusionTensor3D' with [ TParametersValueType=itk::SpatialObject<2>::ScalarType ] C:\Dev\ITK-git\Modules\Core\Common\include\itkSymmetricEigenAnalysis.h(813,12): see reference to function template instantiation 'unsigned int itk::SymmetricEigenAnalysisFixedDimension<3,itk::Matrix,itk::FixedArray,itk::Matrix>::ComputeEigenValuesAndVectorsWithEigenLibraryImpl(const QMatrix &,TVector &,TEigenMatrix &,long) const' being compiled with [ TComponent=itk::SpatialObject<2>::ScalarType, TMatrix=itk::Matrix, QMatrix=itk::Matrix, TVector=itk::FixedArray::ScalarType,3>, TEigenMatrix=itk::Matrix ] C:\Dev\ITK-git\Modules\Core\Common\include\itkSymmetricEigenAnalysis.h(974,27): see reference to function template instantiation 'Eigen::SelfAdjointEigenSolver,itk::FixedArray,itk::Matrix>::ComputeEigenValuesAndVectorsWithEigenLibraryImpl::EigenLibMatrixType>::SelfAdjointEigenSolver(const Eigen::EigenBase &,int)' being compiled with [ TComponent=itk::SpatialObject<2>::ScalarType, Derived=Eigen::Matrix,itk::FixedArray::ScalarType,3>,itk::Matrix>::ComputeEigenValuesAndVectorsWithEigenLibraryImpl::ValueType,3,3,1,3,3> ] C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Eigenvalues\SelfAdjointEigenSolver.h(188,7): see reference to function template instantiation 'Eigen::SelfAdjointEigenSolver,itk::FixedArray,itk::Matrix>::ComputeEigenValuesAndVectorsWithEigenLibraryImpl::EigenLibMatrixType> &Eigen::SelfAdjointEigenSolver,itk::FixedArray,itk::Matrix>::ComputeEigenValuesAndVectorsWithEigenLibraryImpl::EigenLibMatrixType>::compute(const Eigen::EigenBase &,int)' being compiled with [ TComponent=itk::SpatialObject<2>::ScalarType, Derived=Eigen::Matrix,itk::FixedArray::ScalarType,3>,itk::Matrix>::ComputeEigenValuesAndVectorsWithEigenLibraryImpl::ValueType,3,3,1,3,3> ] C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Eigenvalues\SelfAdjointEigenSolver.h(455,26): see reference to class template instantiation 'Eigen::CwiseUnaryOp,const Derived>' being compiled with [ Derived=Eigen::Matrix ] C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\CwiseUnaryOp.h(58,29): see reference to class template instantiation 'Eigen::CwiseUnaryOpImpl::StorageKind>' being compiled with [ UnaryOp=Eigen::internal::scalar_abs_op, XprType=Eigen::Matrix, Derived=Eigen::Matrix ] C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\CwiseUnaryOp.h(98,73): see reference to class template instantiation 'Eigen::MatrixBase' being compiled with [ Derived=Eigen::CwiseUnaryOp,const Eigen::Matrix> ] C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\MatrixBase.h(52,12): see reference to class template instantiation 'Eigen::DenseBase' being compiled with [ Derived=Eigen::CwiseUnaryOp,const Eigen::Matrix> ] C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\DenseBase.h(464,73): while compiling class template member function 'double Eigen::DenseBase::maxCoeff(void) const' with [ Derived=Eigen::CwiseUnaryOp,const Eigen::Matrix> ] C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Eigenvalues\SelfAdjointEigenSolver.h(455,20): see the first reference to 'Eigen::DenseBase::maxCoeff' in 'Eigen::SelfAdjointEigenSolver,itk::FixedArray,itk::Matrix>::ComputeEigenValuesAndVectorsWithEigenLibraryImpl::EigenLibMatrixType>::compute' with [ Derived=Eigen::CwiseUnaryOp,const Eigen::Matrix> ] and [ TComponent=itk::SpatialObject<2>::ScalarType ] C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Eigenvalues\SelfAdjointEigenSolver.h(188,14): see the first reference to 'Eigen::SelfAdjointEigenSolver,itk::FixedArray,itk::Matrix>::ComputeEigenValuesAndVectorsWithEigenLibraryImpl::EigenLibMatrixType>::compute' in 'Eigen::SelfAdjointEigenSolver,itk::FixedArray,itk::Matrix>::ComputeEigenValuesAndVectorsWithEigenLibraryImpl::EigenLibMatrixType>::SelfAdjointEigenSolver' with [ TComponent=itk::SpatialObject<2>::ScalarType ] C:\Dev\ITK-git\Modules\Core\Common\include\itkSymmetricEigenAnalysis.h(974,27): see the first reference to 'Eigen::SelfAdjointEigenSolver,itk::FixedArray,itk::Matrix>::ComputeEigenValuesAndVectorsWithEigenLibraryImpl::EigenLibMatrixType>::SelfAdjointEigenSolver' in 'itk::SymmetricEigenAnalysisFixedDimension<3,itk::Matrix,itk::FixedArray,itk::Matrix>::ComputeEigenValuesAndVectorsWithEigenLibraryImpl' with [ TComponent=itk::SpatialObject<2>::ScalarType ] C:\Dev\ITK-git\Modules\Core\Common\include\itkSymmetricEigenAnalysis.h(813,5): see the first reference to 'itk::SymmetricEigenAnalysisFixedDimension<3,itk::Matrix,itk::FixedArray,itk::Matrix>::ComputeEigenValuesAndVectorsWithEigenLibraryImpl' in 'itk::SymmetricEigenAnalysisFixedDimension<3,itk::Matrix,itk::FixedArray,itk::Matrix>::ComputeEigenValuesAndVectors' with [ TComponent=itk::SpatialObject<2>::ScalarType ] C:\Dev\ITK-git\Modules\Core\Common\include\itkSymmetricSecondRankTensor.hxx(295,52): see the first reference to 'itk::SymmetricEigenAnalysisFixedDimension<3,itk::Matrix,itk::FixedArray,itk::Matrix>::ComputeEigenValuesAndVectors' in 'itk::SymmetricSecondRankTensor::ComputeEigenAnalysis' with [ TComponent=itk::SpatialObject<2>::ScalarType ] C:\Dev\ITK-git\Modules\Core\Transform\include\itkTransform.hxx(323,35): see the first reference to 'itk::SymmetricSecondRankTensor::ComputeEigenAnalysis' in 'itk::Transform::PreservationOfPrincipalDirectionDiffusionTensor3DReorientation' with [ TComponent=itk::SpatialObject<2>::ScalarType ] and [ TParametersValueType=itk::SpatialObject<2>::ScalarType ] C:\Dev\ITK-git\Modules\Core\Transform\include\itkMatrixOffsetTransformBase.hxx(268,11): see the first reference to 'itk::Transform::PreservationOfPrincipalDirectionDiffusionTensor3DReorientation' in 'itk::MatrixOffsetTransformBase::TransformDiffusionTensor3D' with [ TParametersValueType=itk::SpatialObject<2>::ScalarType ] C:\Dev\ITK-git\Modules\Core\Transform\include\itkMatrixOffsetTransformBase.hxx(290,45): see the first reference to 'itk::MatrixOffsetTransformBase::TransformDiffusionTensor3D' in 'itk::MatrixOffsetTransformBase::TransformDiffusionTensor3D' with [ TParametersValueType=itk::SpatialObject<2>::ScalarType ] C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\DenseBase.h(465,14): see reference to function template instantiation 'double Eigen::DenseBase::maxCoeff(void) const' being compiled with [ Derived=Eigen::CwiseUnaryOp,const Eigen::Matrix> ] C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\Redux.h(536,20): see reference to function template instantiation 'double Eigen::DenseBase::redux>(const Func &) const' being compiled with [ Derived=Eigen::CwiseUnaryOp,const Eigen::Matrix>, Func=Eigen::internal::scalar_max_op ] C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\Redux.h(250,57): see reference to class template instantiation 'Eigen::internal::redux_traits' being compiled with [ Func=Eigen::internal::scalar_max_op, Evaluator=Eigen::DenseBase,const Eigen::Matrix>>::redux::ThisEvaluator ] C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\Redux.h(50,45): see reference to class template instantiation 'Eigen::internal::functor_traits' being compiled with [ Func=Eigen::internal::scalar_max_op ] C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\functors\BinaryFunctors.h(189,5): error C2056: illegal expression (compiling source file '../../../../ITKNornir/src/IRFFTCommon.cxx') C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\Redux.h(506,20): error C2976: 'Eigen::internal::redux_impl': too few template arguments (compiling source file '../../../../ITKNornir/src/IRFFTCommon.cxx') C:\Dev\ITK-git\Modules\ThirdParty\Eigen3\src\itkeigen\Eigen\src\Core\Redux.h(253,8): see declaration of 'Eigen::internal::redux_impl' --- include/itkIRUtils.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/include/itkIRUtils.h b/include/itkIRUtils.h index 0ca83c8..52c1ce9 100644 --- a/include/itkIRUtils.h +++ b/include/itkIRUtils.h @@ -477,21 +477,6 @@ operator << (stream_t & so, const std::list & c) } -//---------------------------------------------------------------- -// operator + -// -// Construct an on-the-fly linked list containing two elements: -// -template -inline std::list -operator + (const T & a, const T & b) -{ - std::list ab; - ab.push_back(a); - ab.push_back(b); - return ab; -} - //---------------------------------------------------------------- // operator + //