mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-30 16:52:01 +08:00
Removed a warning when rvalue references are not unsed.
This commit is contained in:
parent
8f4d93a4b7
commit
3444f06f68
@ -26,10 +26,11 @@
|
|||||||
|
|
||||||
#include <Eigen/Core>
|
#include <Eigen/Core>
|
||||||
|
|
||||||
|
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
|
||||||
template <typename MatrixType>
|
template <typename MatrixType>
|
||||||
void rvalue_copyassign(const MatrixType& m)
|
void rvalue_copyassign(const MatrixType& m)
|
||||||
{
|
{
|
||||||
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
|
|
||||||
typedef typename internal::traits<MatrixType>::Scalar Scalar;
|
typedef typename internal::traits<MatrixType>::Scalar Scalar;
|
||||||
|
|
||||||
// create a temporary which we are about to destroy by moving
|
// create a temporary which we are about to destroy by moving
|
||||||
@ -49,8 +50,11 @@ void rvalue_copyassign(const MatrixType& m)
|
|||||||
// verify that the content did not change
|
// verify that the content did not change
|
||||||
Scalar abs_diff = (m-n).array().abs().sum();
|
Scalar abs_diff = (m-n).array().abs().sum();
|
||||||
VERIFY_IS_EQUAL(abs_diff, Scalar(0));
|
VERIFY_IS_EQUAL(abs_diff, Scalar(0));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
template <typename MatrixType>
|
||||||
|
void rvalue_copyassign(const MatrixType&) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
void test_rvalue_types()
|
void test_rvalue_types()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user