mirror of
https://github.com/ETLCPP/etl.git
synced 2026-04-30 19:09:10 +08:00
Fix flat map const placement new issue
This commit is contained in:
parent
d95c1cbc6d
commit
085d2c580a
@ -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"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
name=Embedded Template Library - Arduino
|
||||
version=20.36.0
|
||||
version=20.36.1
|
||||
author= John Wellbelove <john.wellbelove@etlcpp.com>
|
||||
maintainer=John Wellbelove <john.wellbelove@etlcpp.com>
|
||||
license=MIT
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
name=Embedded Template Library
|
||||
version=20.36.0
|
||||
version=20.36.1
|
||||
author= John Wellbelove <john.wellbelove@etlcpp.com>
|
||||
maintainer=John Wellbelove <john.wellbelove@etlcpp.com>
|
||||
license=MIT
|
||||
|
||||
@ -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
|
||||
|
||||
@ -93,14 +93,14 @@
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<EnableASAN>true</EnableASAN>
|
||||
<EnableASAN>false</EnableASAN>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release MSVC C++20 - Optimised O2|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<EnableASAN>true</EnableASAN>
|
||||
<EnableASAN>false</EnableASAN>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug MSVC C++14|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
@ -114,14 +114,14 @@
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<EnableASAN>true</EnableASAN>
|
||||
<EnableASAN>false</EnableASAN>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug MSVC C++17 - No STL|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<EnableASAN>true</EnableASAN>
|
||||
<EnableASAN>false</EnableASAN>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug MSVC C++20 - No STL|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
|
||||
@ -1 +1 @@
|
||||
20.36.0
|
||||
20.36.1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user