mirror of
https://github.com/boostorg/container.git
synced 2025-08-02 05:54:28 +02:00
Fixed in bug in vector::operator==
This commit is contained in:
@@ -1081,6 +1081,7 @@ use [*Boost.Container]? There are several reasons for that:
|
||||
|
||||
[section:release_notes_boost_1_58_00 Boost 1.58 Release]
|
||||
* Added `nth` and `index_of` functions to containers with random-access iterators (except `basic_string`).
|
||||
* Fixed bug in `vector::operator==`.
|
||||
|
||||
[endsect]
|
||||
|
||||
|
@@ -1510,7 +1510,7 @@ class vector
|
||||
{ \
|
||||
T* const back_pos = container_detail::to_raw_pointer \
|
||||
(this->m_holder.start()) + this->m_holder.m_size; \
|
||||
if (BOOST_LIKELY(this->m_holder.m_size < this->m_holder.capacity())){ \
|
||||
if (BOOST_LIKELY(this->m_holder.m_size < this->m_holder.capacity())){ \
|
||||
allocator_traits_type::construct (this->m_holder.alloc() \
|
||||
, back_pos BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) ); \
|
||||
++this->m_holder.m_size; \
|
||||
@@ -1781,8 +1781,8 @@ class vector
|
||||
const_iterator first1(x.cbegin()), first2(y.cbegin());
|
||||
const const_iterator last1(x.cend());
|
||||
for (; first1 != last1; ++first1, ++first2) {
|
||||
if (!(*first1 != *first2)) {
|
||||
return false;
|
||||
if (*first1 != *first2) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -1956,7 +1956,7 @@ class vector
|
||||
bool stable_emplace_back(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
|
||||
{ \
|
||||
const bool room_enough = this->m_holder.m_size < this->m_holder.capacity(); \
|
||||
if (BOOST_LIKELY(room_enough)){ \
|
||||
if (BOOST_LIKELY(room_enough)){ \
|
||||
T* const back_pos = container_detail::to_raw_pointer \
|
||||
(this->m_holder.start()) + this->m_holder.m_size; \
|
||||
allocator_traits_type::construct (this->m_holder.alloc() \
|
||||
@@ -1976,7 +1976,7 @@ class vector
|
||||
size_type priv_index_of(pointer p) const
|
||||
{
|
||||
BOOST_ASSERT(this->m_holder.start() <= p);
|
||||
BOOST_ASSERT(p <= (this->m_holder.start()+size()));
|
||||
BOOST_ASSERT(p <= (this->m_holder.start()+this->size()));
|
||||
return static_cast<size_type>(p - this->m_holder.start());
|
||||
}
|
||||
|
||||
|
@@ -285,6 +285,20 @@ int list_test (bool copied_allocators_equal = true)
|
||||
if(!CheckEqualContainers(boostlist, stdlist))
|
||||
return 1;
|
||||
|
||||
//some comparison operators
|
||||
if(!(boostlist == boostlist))
|
||||
return 1;
|
||||
if(boostlist != boostlist)
|
||||
return 1;
|
||||
if(boostlist < boostlist)
|
||||
return 1;
|
||||
if(boostlist > boostlist)
|
||||
return 1;
|
||||
if(!(boostlist <= boostlist))
|
||||
return 1;
|
||||
if(!(boostlist >= boostlist))
|
||||
return 1;
|
||||
|
||||
if(push_data_t::execute(max, boostlist, stdlist)){
|
||||
return 1;
|
||||
}
|
||||
|
@@ -206,6 +206,20 @@ int map_test()
|
||||
if(!CheckEqualContainers(boostmap2, stdmap2)) return 1;
|
||||
if(!CheckEqualContainers(boostmultimap2, stdmultimap2)) return 1;
|
||||
|
||||
//some comparison operators
|
||||
if(!(boostmap2 == boostmap2))
|
||||
return 1;
|
||||
if(boostmap2 != boostmap2)
|
||||
return 1;
|
||||
if(boostmap2 < boostmap2)
|
||||
return 1;
|
||||
if(boostmap2 > boostmap2)
|
||||
return 1;
|
||||
if(!(boostmap2 <= boostmap2))
|
||||
return 1;
|
||||
if(!(boostmap2 >= boostmap2))
|
||||
return 1;
|
||||
|
||||
::boost::movelib::unique_ptr<MyBoostMap> const pboostmap3 = ::boost::movelib::make_unique<MyBoostMap>
|
||||
( boost::make_move_iterator(&aux_vect[0])
|
||||
, boost::make_move_iterator(&aux_vect[0] + 50));
|
||||
|
@@ -188,7 +188,19 @@ int set_test ()
|
||||
aux_vect3[i] = boost::move(move_me);
|
||||
}
|
||||
|
||||
|
||||
//some comparison operators
|
||||
if(!(boostset2 == boostset2))
|
||||
return 1;
|
||||
if(boostset2 != boostset2)
|
||||
return 1;
|
||||
if(boostset2 < boostset2)
|
||||
return 1;
|
||||
if(boostset2 > boostset2)
|
||||
return 1;
|
||||
if(!(boostset2 <= boostset2))
|
||||
return 1;
|
||||
if(!(boostset2 >= boostset2))
|
||||
return 1;
|
||||
|
||||
::boost::movelib::unique_ptr<MyBoostSet> const pboostset3 = ::boost::movelib::make_unique<MyBoostSet>
|
||||
( ordered_unique_range
|
||||
|
@@ -277,6 +277,20 @@ int vector_test()
|
||||
}
|
||||
if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
|
||||
|
||||
//some comparison operators
|
||||
if(!(boostvector == boostvector))
|
||||
return 1;
|
||||
if(boostvector != boostvector)
|
||||
return 1;
|
||||
if(boostvector < boostvector)
|
||||
return 1;
|
||||
if(boostvector > boostvector)
|
||||
return 1;
|
||||
if(!(boostvector <= boostvector))
|
||||
return 1;
|
||||
if(!(boostvector >= boostvector))
|
||||
return 1;
|
||||
|
||||
//Test insertion from list
|
||||
{
|
||||
std::list<int> l(50, int(1));
|
||||
|
Reference in New Issue
Block a user