diff options
author | Gael Guennebaud <g.gael@free.fr> | 2019-10-10 17:41:47 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2019-10-10 17:41:47 +0200 |
commit | e7d8ba747c7b161eff59959d4d2a5acf788ee00e (patch) | |
tree | 93173c2dd314cc541c34148419126a2bf31b678a /test/meta.cpp | |
parent | fb557aec5c1e4d75ef9293952dbfb03bbb357d6d (diff) |
bug #1752: make is_convertible equivalent to the std c++11 equivalent and fallback to std::is_convertible when c++11 is enabled.
Diffstat (limited to 'test/meta.cpp')
-rw-r--r-- | test/meta.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/meta.cpp b/test/meta.cpp index 51395acd0..b432d9316 100644 --- a/test/meta.cpp +++ b/test/meta.cpp @@ -87,8 +87,12 @@ EIGEN_DECLARE_TEST(meta) STATIC_CHECK(( internal::is_convertible<const Matrix3f&,const Matrix3f&>::value )); STATIC_CHECK((!internal::is_convertible<const Matrix3f&,Matrix3f&>::value )); STATIC_CHECK((!internal::is_convertible<const Matrix3f,Matrix3f&>::value )); - STATIC_CHECK(( internal::is_convertible<Matrix3f,Matrix3f&>::value )); // std::is_convertible returns false here though Matrix3f from; Matrix3f& to = from; is valid. - //STATIC_CHECK((!internal::is_convertible<Matrix3f,Matrix3d>::value )); //does not work because the conversion is prevented by a static assertion + STATIC_CHECK(!( internal::is_convertible<Matrix3f,Matrix3f&>::value )); + + STATIC_CHECK(!( internal::is_convertible<int,int&>::value )); + STATIC_CHECK(( internal::is_convertible<const int,const int& >::value )); + + //STATIC_CHECK((!internal::is_convertible<Matrix3f,Matrix3d>::value )); //does not even compile because the conversion is prevented by a static assertion STATIC_CHECK((!internal::is_convertible<Array33f,int>::value )); STATIC_CHECK((!internal::is_convertible<MatrixXf,float>::value )); { |