aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-09-06 15:47:04 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-09-06 15:47:04 +0200
commitb046a3f87d90d0f815dc03b9fdfcb1fda32504fb (patch)
tree8e06d215e2096ed4683456cf74a165cbaadf68d5 /test
parent3cb914f33285f25de4b3e34ca33bbebc3e0a55d3 (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 'test')
-rw-r--r--test/nullary.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/nullary.cpp b/test/nullary.cpp
index a3c8b991e..9063c6de8 100644
--- a/test/nullary.cpp
+++ b/test/nullary.cpp
@@ -171,8 +171,9 @@ void test_nullary()
VERIFY(( !internal::has_binary_operator<internal::linspaced_op<float,float,false> >::value ));
VERIFY(( internal::functor_has_linear_access<internal::linspaced_op<float,float,false> >::ret ));
- // Regression unit test for a weird MSVC 2012 bug.
- // Search "nullary_wrapper_workaround_msvc_2012" in CoreEvaluators.h for the details.
+ // Regression unit test for a weird MSVC bug.
+ // Search "nullary_wrapper_workaround_msvc" in CoreEvaluators.h for the details.
+ // See also traits<Ref>::match.
{
MatrixXf A = MatrixXf::Random(3,3);
Ref<const MatrixXf> R = 2.0*A;
@@ -183,6 +184,16 @@ void test_nullary()
VectorXi V = VectorXi::Random(3);
Ref<const VectorXi> R2 = VectorXi::LinSpaced(3,1,3)+V;
VERIFY_IS_APPROX(R2, V+Vector3i(1,2,3));
+
+ VERIFY(( internal::has_nullary_operator<internal::scalar_constant_op<float> >::value ));
+ VERIFY(( !internal::has_unary_operator<internal::scalar_constant_op<float> >::value ));
+ VERIFY(( !internal::has_binary_operator<internal::scalar_constant_op<float> >::value ));
+ VERIFY(( internal::functor_has_linear_access<internal::scalar_constant_op<float> >::ret ));
+
+ VERIFY(( !internal::has_nullary_operator<internal::linspaced_op<int,int,false> >::value ));
+ VERIFY(( internal::has_unary_operator<internal::linspaced_op<int,int,false> >::value ));
+ VERIFY(( !internal::has_binary_operator<internal::linspaced_op<int,int,false> >::value ));
+ VERIFY(( internal::functor_has_linear_access<internal::linspaced_op<int,int,false> >::ret ));
}
#endif
}