Implemented LWG Issue #149 (range insertion now returns an iterator) & cleaned up insertion code in most containers

[SVN r80348]
This commit is contained in:
Ion Gaztañaga
2012-09-01 11:01:03 +00:00
parent 011f1fb181
commit 3c256c2282
29 changed files with 1659 additions and 1476 deletions
+25 -2
View File
@@ -12,6 +12,8 @@
#define BOOST_CONTAINER_TEST_CHECK_EQUAL_CONTAINER_HPP
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/pair.hpp>
#include <boost/container/detail/mpl.hpp>
#include <functional>
#include <iostream>
#include <algorithm>
@@ -20,6 +22,24 @@ namespace boost{
namespace container {
namespace test{
template< class T1, class T2>
bool CheckEqual( const T1 &t1, const T2 &t2
, typename boost::container::container_detail::enable_if_c
<!boost::container::container_detail::is_pair<T1>::value &&
!boost::container::container_detail::is_pair<T2>::value
>::type* = 0)
{ return t1 == t2; }
template< class Pair1, class Pair2>
bool CheckEqual( const Pair1 &pair1, const Pair2 &pair2
, typename boost::container::container_detail::enable_if_c
<boost::container::container_detail::is_pair<Pair1>::value &&
boost::container::container_detail::is_pair<Pair2>::value
>::type* = 0)
{
return CheckEqual(pair1.first, pair2.first) && CheckEqual(pair1.second, pair2.second);
}
//Function to check if both containers are equal
template<class MyBoostCont
,class MyStdCont>
@@ -38,10 +58,13 @@ bool CheckEqualContainers(const MyBoostCont *boostcont, const MyStdCont *stdcont
}
std::size_t i = 0;
for(; itboost != itboostend; ++itboost, ++itstd, ++i){
value_type val(*itstd);
if(!CheckEqual(*itstd, *itboost))
return false;
/* value_type val(*itstd);
const value_type &v = *itboost;
if(v != val)
return false;
return false;*/
}
return true;
}