From 6b433d2503ed81bd6577c17748d2ae59ce0573c6 Mon Sep 17 00:00:00 2001 From: Rodolfo Ribeiro Gomes Date: Feb 27 2020 13:32:49 +0000 Subject: add noexcept to move constructor allow to compiler user move in many cases, and thus speeding up execution * http://www.hlsl.co.uk/blog/2017/12/1/c-noexcept-and-move-constructors-effect-on-performance-in-stl-containers * https://stackoverflow.com/questions/3279543/what-is-the-copy-and-swap-idiom --- diff --git a/synfig-core/src/synfig/value.cpp b/synfig-core/src/synfig/value.cpp index 98acf8f..fbf668d 100644 --- a/synfig-core/src/synfig/value.cpp +++ b/synfig-core/src/synfig/value.cpp @@ -107,7 +107,7 @@ ValueBase::ValueBase(const ValueBase& x) interpolation_ = x.interpolation_; } -ValueBase::ValueBase(ValueBase&& x) +ValueBase::ValueBase(ValueBase&& x) noexcept : ValueBase() { swap(*this, x); diff --git a/synfig-core/src/synfig/value.h b/synfig-core/src/synfig/value.h index 8629432..9d7ffcd 100644 --- a/synfig-core/src/synfig/value.h +++ b/synfig-core/src/synfig/value.h @@ -130,7 +130,7 @@ public: ValueBase(const ValueBase &x); //! Move constructor - ValueBase(ValueBase&& x); + ValueBase(ValueBase&& x) noexcept; //! Default destructor virtual ~ValueBase();