forked from boostorg/container
Implemented LWG Issue #149 (range insertion now returns an iterator) & cleaned up insertion code in most containers
[SVN r80348]
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user