From 95dda918f8ecc4e447423a75ef57ae63b16045cb Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sun, 6 Jan 2019 19:09:51 +0000 Subject: [PATCH] Reverted partial changes --- include/etl/flat_map.h | 43 ----------------------- include/etl/forward_list.h | 70 -------------------------------------- 2 files changed, 113 deletions(-) diff --git a/include/etl/flat_map.h b/include/etl/flat_map.h index 8fb59e21..1d83deac 100644 --- a/include/etl/flat_map.h +++ b/include/etl/flat_map.h @@ -76,9 +76,6 @@ namespace etl typedef TKeyCompare key_compare; typedef value_type& reference; typedef const value_type& const_reference; -#if ETL_CPP11_SUPPORTED - typedef value_type&& rvalue_reference; -#endif typedef value_type* pointer; typedef const value_type* const_pointer; typedef size_t size_type; @@ -306,33 +303,6 @@ namespace etl return result; } -#if ETL_CPP11_SUPPORTED - //********************************************************************* - /// Inserts a value to the flat_map. - /// If asserts or exceptions are enabled, emits flat_map_full if the flat_map is already full. - ///\param value The value to insert. - //********************************************************************* - std::pair insert(rvalue_reference value) - { - iterator i_element = lower_bound(value.first); - - std::pair result(i_element, false); - - // Doesn't already exist? - if ((i_element == end()) || compare(i_element->first, value.first) || compare(value.first, i_element->first)) - { - ETL_ASSERT(!refmap_t::full(), ETL_ERROR(flat_map_full)); - - value_type* pvalue = storage.allocate(); - ::new (pvalue) value_type(std::move(value)); - ETL_INCREMENT_DEBUG_COUNT - result = refmap_t::insert_at(i_element, *pvalue); - } - - return result; - } -#endif - //********************************************************************* /// Inserts a value to the flat_map. /// If asserts or exceptions are enabled, emits flat_map_full if the flat_map is already full. @@ -344,19 +314,6 @@ namespace etl return insert(value).first; } -#if ETL_CPP11_SUPPORTED - //********************************************************************* - /// Inserts a value to the flat_map. - /// If asserts or exceptions are enabled, emits flat_map_full if the flat_map is already full. - ///\param position The position to insert at. - ///\param value The value to insert. - //********************************************************************* - iterator insert(iterator position, rvalue_reference value) - { - return insert(std::move(value)).first; - } -#endif - //********************************************************************* /// Inserts a range of values to the flat_map. /// If asserts or exceptions are enabled, emits flat_map_full if the flat_map does not have enough free space. diff --git a/include/etl/forward_list.h b/include/etl/forward_list.h index c46e4f65..038e5de3 100644 --- a/include/etl/forward_list.h +++ b/include/etl/forward_list.h @@ -717,21 +717,6 @@ namespace etl insert_node_after(start_node, data_node); } -#if ETL_CPP11_SUPPORTED - //************************************************************************* - /// Pushes a value to the front of the forward_list. - //************************************************************************* - void push_front(T&& value) - { -#if defined(ETL_CHECK_PUSH_POP) - ETL_ASSERT(!full(), ETL_ERROR(forward_list_full)); -#endif - - data_node_t& data_node = allocate_data_node(std::move(value)); - insert_node_after(start_node, data_node); - } -#endif - #if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) //************************************************************************* /// Emplaces a value to the front of the list.. @@ -885,21 +870,6 @@ namespace etl return iterator(&data_node); } -#if ETL_CPP11_SUPPORTED - //************************************************************************* - /// Inserts a value to the forward_list after the specified position. - //************************************************************************* - iterator insert_after(iterator position, T&& value) - { - ETL_ASSERT(!full(), ETL_ERROR(forward_list_full)); - - data_node_t& data_node = allocate_data_node(std::move(value)); - insert_node_after(*position.p_node, data_node); - - return iterator(&data_node); - } -#endif - #if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) //************************************************************************* /// Emplaces a value to the forward_list after the specified position. @@ -1475,20 +1445,6 @@ namespace etl return *p_node; } -#if ETL_CPP11_SUPPORTED - //************************************************************************* - /// Allocate a data_node_t. - //************************************************************************* - data_node_t& allocate_data_node(T&& value) - { - data_node_t* p_node = p_node_pool->allocate(); - ::new (&(p_node->value)) T(std::move(value)); - ETL_INCREMENT_DEBUG_COUNT - - return *p_node; - } -#endif - //************************************************************************* /// Destroy a data_node_t. //************************************************************************* @@ -1675,17 +1631,6 @@ namespace etl this->assign(other.cbegin(), other.cend()); } -#if ETL_CPP11_SUPPORTED - //************************************************************************* - /// Move constructor. - //************************************************************************* - forward_list(forward_list&& other) - : etl::iforward_list(*other.p_node_pool, other.p_node_pool->max_size(), true) - { - //this->assign(other.cbegin(), other.cend()); - } -#endif - //************************************************************************* /// Construct from range. //************************************************************************* @@ -1728,21 +1673,6 @@ namespace etl return *this; } -#if ETL_CPP11_SUPPORTED - //************************************************************************* - /// Move assignment operator. - //************************************************************************* - forward_list& operator = (forward_list&& rhs) - { - if (&rhs != this) - { - //this->assign(rhs.cbegin(), rhs.cend()); - } - - return *this; - } -#endif - //************************************************************************* /// Set the pool instance. //*************************************************************************