From 3d946e42b314d9a80a82f5551098a99529b93fc7 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 1 Sep 2016 12:59:32 +0200 Subject: Fix compilation with visual studio --- Eigen/src/Core/util/Meta.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index 29c149c34..e5e1b760f 100755 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -381,13 +381,12 @@ struct has_ReturnType enum { value = sizeof(testFunctor(0)) == sizeof(meta_yes) }; }; -template struct meta_array { int a[Size]; }; template const T& return_ref(); template struct has_nullary_operator { - template static meta_yes testFunctor(C const *,meta_array< sizeof(return_ref()()) > * = 0); + template static meta_yes testFunctor(C const *,enable_if<(sizeof(return_ref()())>0)> * = 0); static meta_no testFunctor(...); enum { value = sizeof(testFunctor(static_cast(0))) == sizeof(meta_yes) }; @@ -396,7 +395,7 @@ struct has_nullary_operator template struct has_unary_operator { - template static meta_yes testFunctor(C const *,meta_array< sizeof(return_ref()(Index(0))) > * = 0); + template static meta_yes testFunctor(C const *,enable_if<(sizeof(return_ref()(Index(0)))>0)> * = 0); static meta_no testFunctor(...); enum { value = sizeof(testFunctor(static_cast(0))) == sizeof(meta_yes) }; @@ -405,7 +404,7 @@ struct has_unary_operator template struct has_binary_operator { - template static meta_yes testFunctor(C const *,meta_array< sizeof(return_ref()(Index(0),Index(0))) > * = 0); + template static meta_yes testFunctor(C const *,enable_if<(sizeof(return_ref()(Index(0),Index(0)))>0)> * = 0); static meta_no testFunctor(...); enum { value = sizeof(testFunctor(static_cast(0))) == sizeof(meta_yes) }; -- cgit v1.2.3