Commit 1e5ba118 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[FIX] - whoops. Forgot to make one of the constructors non-explicit.

parent 4c7c4c8f
...@@ -252,7 +252,7 @@ public: ...@@ -252,7 +252,7 @@ public:
* \param m the matrix to copy * \param m the matrix to copy
*/ */
template< typename RHSValueT, ValueStoreTemplate RHSValueStoreT > template< typename RHSValueT, ValueStoreTemplate RHSValueStoreT >
explicit WMatrixFixed( const WMatrixFixed< RHSValueT, Rows, Cols, RHSValueStoreT >& m ) // NOLINT - we do not want it explicit WMatrixFixed( const WMatrixFixed< RHSValueT, Rows, Cols, RHSValueStoreT >& m ) // NOLINT - we do not want it explicit
{ {
setValues( m.m_values ); setValues( m.m_values );
} }
......
...@@ -392,6 +392,21 @@ public: ...@@ -392,6 +392,21 @@ public:
} }
} }
void testCoversion()
{
WMatrixFixed< double, 2, 2 > md;
md( 0, 0 ) = 0.0;
md( 1, 0 ) = 1.0;
md( 0, 1 ) = 2.0;
md( 1, 1 ) = 3.0;
WMatrixFixed< int, 2, 2 > mi( md );
TS_ASSERT( mi( 0, 0 ) == 0 );
TS_ASSERT( mi( 1, 0 ) == 1 );
TS_ASSERT( mi( 0, 1 ) == 2 );
TS_ASSERT( mi( 1, 1 ) == 3 );
}
/** /**
* Test matrix multiplication. * Test matrix multiplication.
*/ */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment