Bugzilla – Attachment 416 Details for
Bug 725
Move constructors are not noexcept
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
This bugzilla service is closed. All entries have been migrated to
https://gitlab.com/libeigen/eigen
[patch]
This patch remedies the issue
eigen_noexcept.patch (text/plain), 5.62 KB, created by
Marton Danoczy
on 2014-01-10 12:02:20 UTC
(
hide
)
Description:
This patch remedies the issue
Filename:
MIME Type:
Creator:
Marton Danoczy
Created:
2014-01-10 12:02:20 UTC
Size:
5.62 KB
patch
obsolete
># HG changeset patch ># User Marton Danoczy <marton78@gmail.com> ># Date 1389351127 -3600 ># Node ID 3acbf2c8ee175c32516d349c701817b7405fc619 ># Parent cc5a1f89efcd27202fe13beced44ef7c86b77ee9 >Added noexcept specifiers to move constructors and assignment operators > >diff -r cc5a1f89efcd -r 3acbf2c8ee17 Eigen/Core >--- a/Eigen/Core Fri Jan 10 11:02:11 2014 +0100 >+++ b/Eigen/Core Fri Jan 10 11:52:07 2014 +0100 >@@ -187,6 +187,11 @@ > // for min/max: > #include <algorithm> > >+// for std::is_nothrow_move_assignable >+#ifdef EIGEN_INCLUDE_TYPE_TRAITS >+#include <type_traits> >+#endif >+ > // for outputting debug info > #ifdef EIGEN_DEBUG_ASSIGN > #include <iostream> >diff -r cc5a1f89efcd -r 3acbf2c8ee17 Eigen/src/Core/Array.h >--- a/Eigen/src/Core/Array.h Fri Jan 10 11:02:11 2014 +0100 >+++ b/Eigen/src/Core/Array.h Fri Jan 10 11:52:07 2014 +0100 >@@ -130,14 +130,14 @@ > #endif > > #ifdef EIGEN_HAVE_RVALUE_REFERENCES >- Array(Array&& other) >+ Array(Array&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_assignable<Scalar>::value) > : Base(std::move(other)) > { > Base::_check_template_params(); > if (RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic) > Base::_set_noalias(other); > } >- Array& operator=(Array&& other) >+ Array& operator=(Array&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_assignable<Scalar>::value) > { > other.swap(*this); > return *this; >diff -r cc5a1f89efcd -r 3acbf2c8ee17 Eigen/src/Core/DenseStorage.h >--- a/Eigen/src/Core/DenseStorage.h Fri Jan 10 11:02:11 2014 +0100 >+++ b/Eigen/src/Core/DenseStorage.h Fri Jan 10 11:52:07 2014 +0100 >@@ -298,14 +298,14 @@ > return *this; > } > #ifdef EIGEN_HAVE_RVALUE_REFERENCES >- DenseStorage(DenseStorage&& other) >+ DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT > : m_data(std::move(other.m_data)) > , m_rows(std::move(other.m_rows)) > , m_cols(std::move(other.m_cols)) > { > other.m_data = nullptr; > } >- DenseStorage& operator=(DenseStorage&& other) >+ DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT > { > using std::swap; > swap(m_data, other.m_data); >@@ -369,13 +369,13 @@ > return *this; > } > #ifdef EIGEN_HAVE_RVALUE_REFERENCES >- DenseStorage(DenseStorage&& other) >+ DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT > : m_data(std::move(other.m_data)) > , m_cols(std::move(other.m_cols)) > { > other.m_data = nullptr; > } >- DenseStorage& operator=(DenseStorage&& other) >+ DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT > { > using std::swap; > swap(m_data, other.m_data); >@@ -435,13 +435,13 @@ > return *this; > } > #ifdef EIGEN_HAVE_RVALUE_REFERENCES >- DenseStorage(DenseStorage&& other) >+ DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT > : m_data(std::move(other.m_data)) > , m_rows(std::move(other.m_rows)) > { > other.m_data = nullptr; > } >- DenseStorage& operator=(DenseStorage&& other) >+ DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT > { > using std::swap; > swap(m_data, other.m_data); >diff -r cc5a1f89efcd -r 3acbf2c8ee17 Eigen/src/Core/Matrix.h >--- a/Eigen/src/Core/Matrix.h Fri Jan 10 11:02:11 2014 +0100 >+++ b/Eigen/src/Core/Matrix.h Fri Jan 10 11:52:07 2014 +0100 >@@ -218,14 +218,14 @@ > { Base::_check_template_params(); EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED } > > #ifdef EIGEN_HAVE_RVALUE_REFERENCES >- Matrix(Matrix&& other) >+ Matrix(Matrix&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_assignable<Scalar>::value) > : Base(std::move(other)) > { > Base::_check_template_params(); > if (RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic) > Base::_set_noalias(other); > } >- Matrix& operator=(Matrix&& other) >+ Matrix& operator=(Matrix&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_assignable<Scalar>::value) > { > other.swap(*this); > return *this; >diff -r cc5a1f89efcd -r 3acbf2c8ee17 Eigen/src/Core/PlainObjectBase.h >--- a/Eigen/src/Core/PlainObjectBase.h Fri Jan 10 11:02:11 2014 +0100 >+++ b/Eigen/src/Core/PlainObjectBase.h Fri Jan 10 11:52:07 2014 +0100 >@@ -466,13 +466,13 @@ > > #ifdef EIGEN_HAVE_RVALUE_REFERENCES > EIGEN_DEVICE_FUNC >- PlainObjectBase(PlainObjectBase&& other) >+ PlainObjectBase(PlainObjectBase&& other) EIGEN_NOEXCEPT > : m_storage( std::move(other.m_storage) ) > { > } > > EIGEN_DEVICE_FUNC >- PlainObjectBase& operator=(PlainObjectBase&& other) >+ PlainObjectBase& operator=(PlainObjectBase&& other) EIGEN_NOEXCEPT > { > using std::swap; > swap(m_storage, other.m_storage); >diff -r cc5a1f89efcd -r 3acbf2c8ee17 Eigen/src/Core/util/Macros.h >--- a/Eigen/src/Core/util/Macros.h Fri Jan 10 11:02:11 2014 +0100 >+++ b/Eigen/src/Core/util/Macros.h Fri Jan 10 11:52:07 2014 +0100 >@@ -110,6 +110,24 @@ > #define EIGEN_HAVE_RVALUE_REFERENCES > #endif > >+// Is noexcept supported? >+#if (__has_feature(cxx_noexcept) || \ >+ (EIGEN_GNUC_AT_LEAST(4,6) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ >+ (defined(_MSC_VER) && _MSC_VER >= 1900)) >+ // full support >+ #define EIGEN_INCLUDE_TYPE_TRAITS >+ #define EIGEN_NOEXCEPT noexcept >+ #define EIGEN_NOEXCEPT_IF(x) noexcept(x) >+#elif defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 180021114) >+ // MSVC Nov 2013 CTP, supports unconditional noexcept only >+ #define EIGEN_NOEXCEPT noexcept >+ #define EIGEN_NOEXCEPT_IF(x) >+#else >+ // no support >+ #define EIGEN_NOEXCEPT >+ #define EIGEN_NOEXCEPT_IF(x) >+#endif >+ > /** Allows to disable some optimizations which might affect the accuracy of the result. > * Such optimization are enabled by default, and set EIGEN_FAST_MATH to 0 to disable them. > * They currently include:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 725
: 416