diff --git a/arduino/library-arduino.json b/arduino/library-arduino.json index 3a6fb90a..786adff7 100644 --- a/arduino/library-arduino.json +++ b/arduino/library-arduino.json @@ -1,6 +1,6 @@ { "name": "Embedded Template Library - Arduino", - "version": "20.35.0", + "version": "20.35.1", "authors": { "name": "John Wellbelove", "email": "john.wellbelove@etlcpp.com" diff --git a/arduino/library-arduino.properties b/arduino/library-arduino.properties index 6935809b..f4c3e2a7 100644 --- a/arduino/library-arduino.properties +++ b/arduino/library-arduino.properties @@ -1,5 +1,5 @@ name=Embedded Template Library - Arduino -version=20.35.0 +version=20.35.1 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/include/etl/memory.h b/include/etl/memory.h index 0f064b18..1498b71a 100644 --- a/include/etl/memory.h +++ b/include/etl/memory.h @@ -1307,10 +1307,23 @@ namespace etl #if ETL_USING_CPP11 //********************************* - unique_ptr(unique_ptr&& p_) ETL_NOEXCEPT - : p(p_.release()) - , deleter(etl::move(p_.deleter)) + unique_ptr(unique_ptr&& other) ETL_NOEXCEPT { + if (&other != this) + { + p = other.release(); + deleter = etl::move(other.deleter); + } + } +#else + //********************************* + unique_ptr(unique_ptr& other) ETL_NOEXCEPT + { + if (&other != this) + { + p = other.release(); + deleter = other.deleter; + } } #endif @@ -1330,6 +1343,13 @@ namespace etl , deleter(etl::move(deleter_)) { } + + template + unique_ptr(unique_ptr&& u) ETL_NOEXCEPT + : p(u.release()) + , deleter(etl::forward(u.get_deleter())) + { + } #endif template @@ -1419,9 +1439,25 @@ namespace etl #if ETL_USING_CPP11 //********************************* - unique_ptr& operator =(unique_ptr&& p_) ETL_NOEXCEPT + unique_ptr& operator =(unique_ptr&& other) ETL_NOEXCEPT { - reset(p_.release()); + if (&other != this) + { + reset(other.release()); + deleter = etl::move(other.deleter); + } + + return *this; + } +#else + //********************************* + unique_ptr& operator =(unique_ptr& other) ETL_NOEXCEPT + { + if (&other != this) + { + reset(other.release()); + deleter = other.deleter; + } return *this; } @@ -1471,7 +1507,7 @@ namespace etl typedef T& reference; //********************************* - ETL_CONSTEXPR unique_ptr() ETL_NOEXCEPT + ETL_CONSTEXPR unique_ptr() ETL_NOEXCEPT : p(ETL_NULLPTR) { } @@ -1484,17 +1520,31 @@ namespace etl #if ETL_USING_CPP11 //********************************* - unique_ptr(unique_ptr&& p_) ETL_NOEXCEPT - : p(p_.release()) - , deleter(etl::move(p_.deleter)) + unique_ptr(unique_ptr&& other) ETL_NOEXCEPT { + if (&other != this) + { + p = other.release(); + deleter = etl::move(other.deleter); + } + } +#else + //********************************* + unique_ptr(unique_ptr& other) ETL_NOEXCEPT + { + if (&other != this) + { + p = other.release(); + deleter = other.deleter; + } } #endif //********************************* - unique_ptr(pointer p_, typename etl::conditional::value, - TDeleter, - typename etl::add_lvalue_reference::type>::type deleter_) ETL_NOEXCEPT + unique_ptr(pointer p_, + typename etl::conditional::value, + TDeleter, + typename etl::add_lvalue_reference::type>::type deleter_) ETL_NOEXCEPT : p(p_) , deleter(deleter_) { @@ -1507,6 +1557,13 @@ namespace etl , deleter(etl::move(deleter_)) { } + + template + unique_ptr(unique_ptr&& u) ETL_NOEXCEPT + : p(u.release()) + , deleter(etl::forward(u.get_deleter())) + { + } #endif //********************************* @@ -1588,9 +1645,25 @@ namespace etl #if ETL_USING_CPP11 //********************************* - unique_ptr& operator =(unique_ptr&& p_) ETL_NOEXCEPT + unique_ptr& operator =(unique_ptr&& other) ETL_NOEXCEPT { - reset(p_.release()); + if (&other != this) + { + reset(other.release()); + deleter = etl::move(other.deleter); + } + + return *this; + } +#else + //********************************* + unique_ptr& operator =(unique_ptr& other) ETL_NOEXCEPT + { + if (&other != this) + { + reset(other.release()); + deleter = other.deleter; + } return *this; } diff --git a/include/etl/version.h b/include/etl/version.h index bf1bf269..52f15914 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -40,7 +40,7 @@ SOFTWARE. #define ETL_VERSION_MAJOR 20 #define ETL_VERSION_MINOR 35 -#define ETL_VERSION_PATCH 0 +#define ETL_VERSION_PATCH 1 #define ETL_VERSION ETL_STRING(ETL_VERSION_MAJOR) "." ETL_STRING(ETL_VERSION_MINOR) "." ETL_STRING(ETL_VERSION_PATCH) #define ETL_VERSION_W ETL_WIDE_STRING(ETL_VERSION_MAJOR) L"." ETL_WIDE_STRING(ETL_VERSION_MINOR) L"." ETL_WIDE_STRING(ETL_VERSION_PATCH) diff --git a/library.json b/library.json index 5f517484..7c00a010 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Embedded Template Library", - "version": "20.35.0", + "version": "20.35.1", "authors": { "name": "John Wellbelove", "email": "john.wellbelove@etlcpp.com" diff --git a/library.properties b/library.properties index 49b54c12..62f299b5 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=20.35.0 +version=20.35.1 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/support/Release notes.txt b/support/Release notes.txt index 96a866f6..ca097a54 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,9 @@ +=============================================================================== +20.35.1 +#628 Fixed set of ETL_NO_STL flag in meson.build +#631 unique_ptr derived copy or move to base does not compile +Removed duplicate include in etl::array_view + =============================================================================== 20.35.0 #596 Helper functions to convert strings to numeric values. etl::to_arithmetic diff --git a/version.txt b/version.txt index 9c4538fe..5e97989f 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -20.35.0 +20.35.1