diff options
author | Gael Guennebaud <g.gael@free.fr> | 2016-09-06 15:47:04 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2016-09-06 15:47:04 +0200 |
commit | b046a3f87d90d0f815dc03b9fdfcb1fda32504fb (patch) | |
tree | 8e06d215e2096ed4683456cf74a165cbaadf68d5 /Eigen/src/Core/CoreEvaluators.h | |
parent | 3cb914f33285f25de4b3e34ca33bbebc3e0a55d3 (diff) |
Workaround MSVC instantiation faillure of has_*ary_operator at the level of triats<Ref>::match so that the has_*ary_operator are really properly instantiated throughout the compilation unit.
Diffstat (limited to 'Eigen/src/Core/CoreEvaluators.h')
-rw-r--r-- | Eigen/src/Core/CoreEvaluators.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/Eigen/src/Core/CoreEvaluators.h b/Eigen/src/Core/CoreEvaluators.h index c5ad37847..ece8c0fcf 100644 --- a/Eigen/src/Core/CoreEvaluators.h +++ b/Eigen/src/Core/CoreEvaluators.h @@ -393,9 +393,9 @@ struct nullary_wrapper<Scalar,NullaryOp,false,true,false> template<typename Scalar,typename NullaryOp> struct nullary_wrapper<Scalar,NullaryOp,false,false,false> {}; -#if EIGEN_COMP_MSVC>0 && EIGEN_COMP_MSVC<=1700 +#if EIGEN_COMP_MSVC>0 -// MSVC 2012 (and probably older ones too) exhibits a weird compilation error when +// MSVC exhibits a weird compilation error when // compiling: // Eigen::MatrixXf A = MatrixXf::Random(3,3); // Ref<const MatrixXf> R = 2.f*A; @@ -408,8 +408,8 @@ struct nullary_wrapper<Scalar,NullaryOp,false,false,false> {}; // This is a simple wrapper around Index to enforce the re-instantiation of // has_*ary_operator when needed. -template<typename T> struct nullary_wrapper_workaround_msvc_2012 { - nullary_wrapper_workaround_msvc_2012(const T&); +template<typename T> struct nullary_wrapper_workaround_msvc { + nullary_wrapper_workaround_msvc(const T&); operator T()const; }; @@ -419,34 +419,34 @@ struct nullary_wrapper<Scalar,NullaryOp,true,true,true> template <typename IndexType> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i, IndexType j) const { return nullary_wrapper<Scalar,NullaryOp, - has_nullary_operator<NullaryOp,nullary_wrapper_workaround_msvc_2012<IndexType> >::value, - has_unary_operator<NullaryOp,nullary_wrapper_workaround_msvc_2012<IndexType> >::value, - has_binary_operator<NullaryOp,nullary_wrapper_workaround_msvc_2012<IndexType> >::value>().operator()(op,i,j); + has_nullary_operator<NullaryOp,nullary_wrapper_workaround_msvc<IndexType> >::value, + has_unary_operator<NullaryOp,nullary_wrapper_workaround_msvc<IndexType> >::value, + has_binary_operator<NullaryOp,nullary_wrapper_workaround_msvc<IndexType> >::value>().operator()(op,i,j); } template <typename IndexType> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i) const { return nullary_wrapper<Scalar,NullaryOp, - has_nullary_operator<NullaryOp,nullary_wrapper_workaround_msvc_2012<IndexType> >::value, - has_unary_operator<NullaryOp,nullary_wrapper_workaround_msvc_2012<IndexType> >::value, - has_binary_operator<NullaryOp,nullary_wrapper_workaround_msvc_2012<IndexType> >::value>().operator()(op,i); + has_nullary_operator<NullaryOp,nullary_wrapper_workaround_msvc<IndexType> >::value, + has_unary_operator<NullaryOp,nullary_wrapper_workaround_msvc<IndexType> >::value, + has_binary_operator<NullaryOp,nullary_wrapper_workaround_msvc<IndexType> >::value>().operator()(op,i); } template <typename T, typename IndexType> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType i, IndexType j) const { return nullary_wrapper<Scalar,NullaryOp, - has_nullary_operator<NullaryOp,nullary_wrapper_workaround_msvc_2012<IndexType> >::value, - has_unary_operator<NullaryOp,nullary_wrapper_workaround_msvc_2012<IndexType> >::value, - has_binary_operator<NullaryOp,nullary_wrapper_workaround_msvc_2012<IndexType> >::value>().template packetOp<T>(op,i,j); + has_nullary_operator<NullaryOp,nullary_wrapper_workaround_msvc<IndexType> >::value, + has_unary_operator<NullaryOp,nullary_wrapper_workaround_msvc<IndexType> >::value, + has_binary_operator<NullaryOp,nullary_wrapper_workaround_msvc<IndexType> >::value>().template packetOp<T>(op,i,j); } template <typename T, typename IndexType> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType i) const { return nullary_wrapper<Scalar,NullaryOp, - has_nullary_operator<NullaryOp,nullary_wrapper_workaround_msvc_2012<IndexType> >::value, - has_unary_operator<NullaryOp,nullary_wrapper_workaround_msvc_2012<IndexType> >::value, - has_binary_operator<NullaryOp,nullary_wrapper_workaround_msvc_2012<IndexType> >::value>().template packetOp<T>(op,i); + has_nullary_operator<NullaryOp,nullary_wrapper_workaround_msvc<IndexType> >::value, + has_unary_operator<NullaryOp,nullary_wrapper_workaround_msvc<IndexType> >::value, + has_binary_operator<NullaryOp,nullary_wrapper_workaround_msvc<IndexType> >::value>().template packetOp<T>(op,i); } }; -#endif // MSVC<=2012 workaround +#endif // MSVC workaround template<typename NullaryOp, typename PlainObjectType> struct evaluator<CwiseNullaryOp<NullaryOp,PlainObjectType> > |