mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-09 14:49:53 +08:00
Reverted partial changes
This commit is contained in:
parent
349db3aacd
commit
95dda918f8
@ -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<iterator, bool> insert(rvalue_reference value)
|
||||
{
|
||||
iterator i_element = lower_bound(value.first);
|
||||
|
||||
std::pair<iterator, bool> 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<value_type>();
|
||||
::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.
|
||||
|
||||
@ -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<data_node_t>();
|
||||
::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<T>(*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.
|
||||
//*************************************************************************
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user