mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-15 07:10:37 +08:00
bug #1571: fix is_convertible<from,to> with "from" a reference.
This commit is contained in:
parent
1920129d71
commit
20991c3203
@ -161,7 +161,7 @@ private:
|
||||
static no test(any_conversion, ...);
|
||||
|
||||
public:
|
||||
static From* ms_from;
|
||||
static typename internal::remove_reference<From>::type* ms_from;
|
||||
#ifdef __INTEL_COMPILER
|
||||
#pragma warning push
|
||||
#pragma warning ( disable : 2259 )
|
||||
|
@ -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 ));
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user