From f36538049669a7efee57f2b1e3c60bf8bf3976bb Mon Sep 17 00:00:00 2001 From: Christoph Hertzberg Date: Fri, 4 Jul 2014 12:52:55 +0200 Subject: Fix regression introduced by 3117036b80075390dbc46f60aa0d595e5a44661b : Matrix(int) did not compile if Scalar is not constructible from int. Now this falls back to the (Index size) constructor. --- Eigen/src/Core/util/Meta.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Eigen/src/Core/util/Meta.h') diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index e4e4d4a87..795197f59 100644 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -80,6 +80,25 @@ template struct add_const_on_value_type { typedef T const template struct add_const_on_value_type { typedef T const* const type; }; template struct add_const_on_value_type { typedef T const* const type; }; + +template +struct is_convertible +{ +private: + struct yes {int a[1];}; + struct no {int a[2];}; + + template + static yes test (const T&) {} + + template static no test (...) {} + +public: + static From ms_from; + enum { value = sizeof(test(ms_from))==sizeof(yes) }; +}; + + /** \internal Allows to enable/disable an overload * according to a compile time condition. */ -- cgit v1.2.3