aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/meta.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2018-07-13 17:47:28 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2018-07-13 17:47:28 +0200
commit20991c3203818e685dbfd89e20408e5f1b254346 (patch)
tree0d4a37ea55a5f65c8929fdd8f27b76d93546f967 /test/meta.cpp
parent1920129d7184d86603e15667989d69ee0e40d07d (diff)
bug #1571: fix is_convertible<from,to> with "from" a reference.
Diffstat (limited to 'test/meta.cpp')
-rw-r--r--test/meta.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/meta.cpp b/test/meta.cpp
index 4904f3ba4..34c5520a6 100644
--- a/test/meta.cpp
+++ b/test/meta.cpp
@@ -80,7 +80,15 @@ void test_meta()
STATIC_CHECK(( internal::is_convertible<double,std::complex<double> >::value ));
STATIC_CHECK((!internal::is_convertible<std::complex<double>,double>::value ));
STATIC_CHECK(( internal::is_convertible<Array33f,Matrix3f>::value ));
-// VERIFY((!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<Matrix3f&,Matrix3f&>::value ));
+ STATIC_CHECK(( internal::is_convertible<Matrix3f&,const Matrix3f&>::value ));
+ STATIC_CHECK(( internal::is_convertible<const Matrix3f&,Matrix3f>::value ));
+ 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<Array33f,int>::value ));
STATIC_CHECK((!internal::is_convertible<MatrixXf,float>::value ));
{