diff --git a/arduino/library-arduino.json b/arduino/library-arduino.json index b9585aed..e6febba7 100644 --- a/arduino/library-arduino.json +++ b/arduino/library-arduino.json @@ -1,6 +1,6 @@ { "name": "Embedded Template Library - Arduino", - "version": "20.36.0", + "version": "20.36.1", "authors": { "name": "John Wellbelove", "email": "john.wellbelove@etlcpp.com" diff --git a/arduino/library-arduino.properties b/arduino/library-arduino.properties index fe77f3fc..fe5bce62 100644 --- a/arduino/library-arduino.properties +++ b/arduino/library-arduino.properties @@ -1,5 +1,5 @@ name=Embedded Template Library - Arduino -version=20.36.0 +version=20.36.1 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/include/etl/flat_map.h b/include/etl/flat_map.h index e095e90d..0cae36c4 100644 --- a/include/etl/flat_map.h +++ b/include/etl/flat_map.h @@ -1056,7 +1056,7 @@ namespace etl ::new ((void*)etl::addressof(pvalue->first)) key_type(etl::move(key)); ::new ((void*)etl::addressof(pvalue->second)) mapped_type(); ETL_INCREMENT_DEBUG_COUNT - + return refmap_t::insert_at(i_element, *pvalue); } #endif diff --git a/include/etl/map.h b/include/etl/map.h index 7f94e756..6e7abb7a 100644 --- a/include/etl/map.h +++ b/include/etl/map.h @@ -935,18 +935,13 @@ namespace etl ETL_ASSERT(!full(), ETL_ERROR(map_full)); // Get next available free node - Data_Node& node = create_data_node(); - - ::new ((void*)etl::addressof(node.value.first)) key_type(etl::move(key)); - ::new ((void*)etl::addressof(node.value.second)) mapped_type(); + Data_Node& node = allocate_data_node_with_key(etl::move(key)); // Obtain the inserted node (might be ETL_NULLPTR if node was a duplicate) inserted_node = insert_node(root_node, node); // Insert node into tree and return iterator to new node location in tree i_element = iterator(*this, inserted_node); - - ETL_INCREMENT_DEBUG_COUNT } return i_element->second; @@ -970,10 +965,7 @@ namespace etl ETL_ASSERT(!full(), ETL_ERROR(map_full)); // Get next available free node - Data_Node& node = create_data_node(); - - ::new (etl::addressof(node.value.first)) key_type(key); - ::new (etl::addressof(node.value.second)) mapped_type(); + Data_Node& node = allocate_data_node_with_key(key); // Obtain the inserted node (might be ETL_NULLPTR if node was a duplicate) inserted_node = insert_node(root_node, node); @@ -1510,6 +1502,19 @@ namespace etl return node; } + //************************************************************************* + /// Allocate a Data_Node with the supplied key. + //************************************************************************* + Data_Node& allocate_data_node_with_key(const_key_reference key) + { + Data_Node& node = create_data_node(); + + ::new ((void*)etl::addressof(node.value.first)) key_type(key); + ::new ((void*)etl::addressof(node.value.second)) mapped_type(); + ETL_INCREMENT_DEBUG_COUNT + return node; + } + #if ETL_USING_CPP11 //************************************************************************* /// Allocate a Data_Node. @@ -1521,6 +1526,20 @@ namespace etl ETL_INCREMENT_DEBUG_COUNT return node; } + + //************************************************************************* + /// Allocate a Data_Node with the supplied key. + //************************************************************************* + Data_Node& allocate_data_node_with_key(rvalue_key_reference key) + { + Data_Node& node = create_data_node(); + + ::new ((void*)etl::addressof(node.value.first)) key_type(etl::move(key)); + ::new ((void*)etl::addressof(node.value.second)) mapped_type(); + ETL_INCREMENT_DEBUG_COUNT + return node; + } + #endif //************************************************************************* diff --git a/include/etl/version.h b/include/etl/version.h index 5946772d..749c5761 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 36 -#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 b120a16a..8c12eaaa 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Embedded Template Library", - "version": "20.36.0", + "version": "20.36.1", "authors": { "name": "John Wellbelove", "email": "john.wellbelove@etlcpp.com" diff --git a/library.properties b/library.properties index 88400749..295a0ae2 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=20.36.0 +version=20.36.1 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/support/Release notes.txt b/support/Release notes.txt index 3e58b107..77a473b4 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,8 @@ +=============================================================================== +20.36.1 +#700 Compilation error for [] map operator. Fixed map const placement new issue. +Re-enabled memcast tests. + =============================================================================== 20.36.0 #663 Make unit tests compile for C++20 diff --git a/test/vs2022/etl.vcxproj b/test/vs2022/etl.vcxproj index 07073dcf..e04bc16e 100644 --- a/test/vs2022/etl.vcxproj +++ b/test/vs2022/etl.vcxproj @@ -93,14 +93,14 @@ true v143 Unicode - true + false Application true v143 Unicode - true + false Application @@ -114,14 +114,14 @@ true v143 Unicode - true + false Application true v143 Unicode - true + false Application diff --git a/version.txt b/version.txt index c81a2519..5649214d 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -20.36.0 +20.36.1