This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
View | Details | Raw Unified | Return to bug 725
Collapse All | Expand All

(-)a/Eigen/Core (+5 lines)
Lines 187-192 Link Here
187
// for min/max:
187
// for min/max:
188
#include <algorithm>
188
#include <algorithm>
189
189
190
// for std::is_nothrow_move_assignable
191
#ifdef EIGEN_INCLUDE_TYPE_TRAITS
192
#include <type_traits>
193
#endif
194
190
// for outputting debug info
195
// for outputting debug info
191
#ifdef EIGEN_DEBUG_ASSIGN
196
#ifdef EIGEN_DEBUG_ASSIGN
192
#include <iostream>
197
#include <iostream>
(-)a/Eigen/src/Core/Array.h (-2 / +2 lines)
Lines 130-143 Link Here
130
#endif
130
#endif
131
131
132
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
132
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
133
    Array(Array&& other)
133
    Array(Array&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_assignable<Scalar>::value)
134
      : Base(std::move(other))
134
      : Base(std::move(other))
135
    {
135
    {
136
      Base::_check_template_params();
136
      Base::_check_template_params();
137
      if (RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic)
137
      if (RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic)
138
        Base::_set_noalias(other);
138
        Base::_set_noalias(other);
139
    }
139
    }
140
    Array& operator=(Array&& other)
140
    Array& operator=(Array&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_assignable<Scalar>::value)
141
    {
141
    {
142
      other.swap(*this);
142
      other.swap(*this);
143
      return *this;
143
      return *this;
(-)a/Eigen/src/Core/DenseStorage.h (-6 / +6 lines)
Lines 298-311 Link Here
298
      return *this;
298
      return *this;
299
    }
299
    }
300
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
300
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
301
    DenseStorage(DenseStorage&& other)
301
    DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT
302
      : m_data(std::move(other.m_data))
302
      : m_data(std::move(other.m_data))
303
      , m_rows(std::move(other.m_rows))
303
      , m_rows(std::move(other.m_rows))
304
      , m_cols(std::move(other.m_cols))
304
      , m_cols(std::move(other.m_cols))
305
    {
305
    {
306
      other.m_data = nullptr;
306
      other.m_data = nullptr;
307
    }
307
    }
308
    DenseStorage& operator=(DenseStorage&& other)
308
    DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT
309
    {
309
    {
310
      using std::swap;
310
      using std::swap;
311
      swap(m_data, other.m_data);
311
      swap(m_data, other.m_data);
Lines 369-381 Link Here
369
      return *this;
369
      return *this;
370
    }    
370
    }    
371
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
371
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
372
    DenseStorage(DenseStorage&& other)
372
    DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT
373
      : m_data(std::move(other.m_data))
373
      : m_data(std::move(other.m_data))
374
      , m_cols(std::move(other.m_cols))
374
      , m_cols(std::move(other.m_cols))
375
    {
375
    {
376
      other.m_data = nullptr;
376
      other.m_data = nullptr;
377
    }
377
    }
378
    DenseStorage& operator=(DenseStorage&& other)
378
    DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT
379
    {
379
    {
380
      using std::swap;
380
      using std::swap;
381
      swap(m_data, other.m_data);
381
      swap(m_data, other.m_data);
Lines 435-447 Link Here
435
      return *this;
435
      return *this;
436
    }    
436
    }    
437
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
437
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
438
    DenseStorage(DenseStorage&& other)
438
    DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT
439
      : m_data(std::move(other.m_data))
439
      : m_data(std::move(other.m_data))
440
      , m_rows(std::move(other.m_rows))
440
      , m_rows(std::move(other.m_rows))
441
    {
441
    {
442
      other.m_data = nullptr;
442
      other.m_data = nullptr;
443
    }
443
    }
444
    DenseStorage& operator=(DenseStorage&& other)
444
    DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT
445
    {
445
    {
446
      using std::swap;
446
      using std::swap;
447
      swap(m_data, other.m_data);
447
      swap(m_data, other.m_data);
(-)a/Eigen/src/Core/Matrix.h (-2 / +2 lines)
Lines 218-231 Link Here
218
    { Base::_check_template_params(); EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED }
218
    { Base::_check_template_params(); EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED }
219
219
220
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
220
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
221
    Matrix(Matrix&& other)
221
    Matrix(Matrix&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_assignable<Scalar>::value)
222
      : Base(std::move(other))
222
      : Base(std::move(other))
223
    {
223
    {
224
      Base::_check_template_params();
224
      Base::_check_template_params();
225
      if (RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic)
225
      if (RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic)
226
        Base::_set_noalias(other);
226
        Base::_set_noalias(other);
227
    }
227
    }
228
    Matrix& operator=(Matrix&& other)
228
    Matrix& operator=(Matrix&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_assignable<Scalar>::value)
229
    {
229
    {
230
      other.swap(*this);
230
      other.swap(*this);
231
      return *this;
231
      return *this;
(-)a/Eigen/src/Core/PlainObjectBase.h (-2 / +2 lines)
Lines 466-478 Link Here
466
466
467
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
467
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
468
    EIGEN_DEVICE_FUNC
468
    EIGEN_DEVICE_FUNC
469
    PlainObjectBase(PlainObjectBase&& other)
469
    PlainObjectBase(PlainObjectBase&& other) EIGEN_NOEXCEPT
470
      : m_storage( std::move(other.m_storage) )
470
      : m_storage( std::move(other.m_storage) )
471
    {
471
    {
472
    }
472
    }
473
473
474
    EIGEN_DEVICE_FUNC
474
    EIGEN_DEVICE_FUNC
475
    PlainObjectBase& operator=(PlainObjectBase&& other)
475
    PlainObjectBase& operator=(PlainObjectBase&& other) EIGEN_NOEXCEPT
476
    {
476
    {
477
      using std::swap;
477
      using std::swap;
478
      swap(m_storage, other.m_storage);
478
      swap(m_storage, other.m_storage);
(-)a/Eigen/src/Core/util/Macros.h (+18 lines)
Lines 110-115 Link Here
110
  #define EIGEN_HAVE_RVALUE_REFERENCES
110
  #define EIGEN_HAVE_RVALUE_REFERENCES
111
#endif
111
#endif
112
112
113
// Is noexcept supported?
114
#if (__has_feature(cxx_noexcept) || \
115
    (EIGEN_GNUC_AT_LEAST(4,6) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \
116
    (defined(_MSC_VER) && _MSC_VER >= 1900))
117
  // full support
118
  #define EIGEN_INCLUDE_TYPE_TRAITS
119
  #define EIGEN_NOEXCEPT noexcept
120
  #define EIGEN_NOEXCEPT_IF(x) noexcept(x)
121
#elif defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 180021114)
122
  // MSVC Nov 2013 CTP, supports unconditional noexcept only
123
  #define EIGEN_NOEXCEPT noexcept
124
  #define EIGEN_NOEXCEPT_IF(x)
125
#else
126
  // no support
127
  #define EIGEN_NOEXCEPT
128
  #define EIGEN_NOEXCEPT_IF(x)
129
#endif
130
113
/** Allows to disable some optimizations which might affect the accuracy of the result.
131
/** Allows to disable some optimizations which might affect the accuracy of the result.
114
  * Such optimization are enabled by default, and set EIGEN_FAST_MATH to 0 to disable them.
132
  * Such optimization are enabled by default, and set EIGEN_FAST_MATH to 0 to disable them.
115
  * They currently include:
133
  * They currently include:

Return to bug 725