mirror of
https://github.com/boostorg/container.git
synced 2025-08-03 14:34:27 +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]
|
[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`).
|
* Added `nth` and `index_of` functions to containers with random-access iterators (except `basic_string`).
|
||||||
|
* Fixed bug in `vector::operator==`.
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
|
@@ -1781,7 +1781,7 @@ class vector
|
|||||||
const_iterator first1(x.cbegin()), first2(y.cbegin());
|
const_iterator first1(x.cbegin()), first2(y.cbegin());
|
||||||
const const_iterator last1(x.cend());
|
const const_iterator last1(x.cend());
|
||||||
for (; first1 != last1; ++first1, ++first2) {
|
for (; first1 != last1; ++first1, ++first2) {
|
||||||
if (!(*first1 != *first2)) {
|
if (*first1 != *first2) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1976,7 +1976,7 @@ class vector
|
|||||||
size_type priv_index_of(pointer p) const
|
size_type priv_index_of(pointer p) const
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(this->m_holder.start() <= p);
|
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());
|
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))
|
if(!CheckEqualContainers(boostlist, stdlist))
|
||||||
return 1;
|
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)){
|
if(push_data_t::execute(max, boostlist, stdlist)){
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@@ -206,6 +206,20 @@ int map_test()
|
|||||||
if(!CheckEqualContainers(boostmap2, stdmap2)) return 1;
|
if(!CheckEqualContainers(boostmap2, stdmap2)) return 1;
|
||||||
if(!CheckEqualContainers(boostmultimap2, stdmultimap2)) 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::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])
|
||||||
, boost::make_move_iterator(&aux_vect[0] + 50));
|
, boost::make_move_iterator(&aux_vect[0] + 50));
|
||||||
|
@@ -188,7 +188,19 @@ int set_test ()
|
|||||||
aux_vect3[i] = boost::move(move_me);
|
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>
|
::boost::movelib::unique_ptr<MyBoostSet> const pboostset3 = ::boost::movelib::make_unique<MyBoostSet>
|
||||||
( ordered_unique_range
|
( ordered_unique_range
|
||||||
|
@@ -277,6 +277,20 @@ int vector_test()
|
|||||||
}
|
}
|
||||||
if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
|
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
|
//Test insertion from list
|
||||||
{
|
{
|
||||||
std::list<int> l(50, int(1));
|
std::list<int> l(50, int(1));
|
||||||
|
Reference in New Issue
Block a user