forked from boostorg/container
Merge container from trunk
[SVN r78593]
This commit is contained in:
1 parent
de1eec1ad3
commit
74bb68a0cd
27 files changed
+371
-151
No files matched your search
@@ -23,17 +23,17 @@ namespace test{
|
||||
//Function to check if both containers are equal
|
||||
template<class MyBoostCont
|
||||
,class MyStdCont>
|
||||
bool CheckEqualContainers(MyBoostCont *boostcont, MyStdCont *stdcont)
|
||||
bool CheckEqualContainers(const MyBoostCont *boostcont, const MyStdCont *stdcont)
|
||||
{
|
||||
if(boostcont->size() != stdcont->size())
|
||||
return false;
|
||||
|
||||
typedef typename MyBoostCont::value_type value_type;
|
||||
|
||||
typename MyBoostCont::iterator itboost(boostcont->begin()), itboostend(boostcont->end());
|
||||
typename MyStdCont::iterator itstd(stdcont->begin());
|
||||
typename MyBoostCont::const_iterator itboost(boostcont->begin()), itboostend(boostcont->end());
|
||||
typename MyStdCont::const_iterator itstd(stdcont->begin());
|
||||
typename MyStdCont::size_type dist = (typename MyStdCont::size_type)std::distance(itboost, itboostend);
|
||||
if(dist != boostcont->size()){
|
||||
if(dist != boostcont->size()){
|
||||
return false;
|
||||
}
|
||||
std::size_t i = 0;
|
||||
@@ -48,7 +48,7 @@ bool CheckEqualContainers(MyBoostCont *boostcont, MyStdCont *stdcont)
|
||||
|
||||
template<class MyBoostCont
|
||||
,class MyStdCont>
|
||||
bool CheckEqualPairContainers(MyBoostCont *boostcont, MyStdCont *stdcont)
|
||||
bool CheckEqualPairContainers(const MyBoostCont *boostcont, const MyStdCont *stdcont)
|
||||
{
|
||||
if(boostcont->size() != stdcont->size())
|
||||
return false;
|
||||
@@ -56,8 +56,8 @@ bool CheckEqualPairContainers(MyBoostCont *boostcont, MyStdCont *stdcont)
|
||||
typedef typename MyBoostCont::key_type key_type;
|
||||
typedef typename MyBoostCont::mapped_type mapped_type;
|
||||
|
||||
typename MyBoostCont::iterator itboost(boostcont->begin()), itboostend(boostcont->end());
|
||||
typename MyStdCont::iterator itstd(stdcont->begin());
|
||||
typename MyBoostCont::const_iterator itboost(boostcont->begin()), itboostend(boostcont->end());
|
||||
typename MyStdCont::const_iterator itstd(stdcont->begin());
|
||||
for(; itboost != itboostend; ++itboost, ++itstd){
|
||||
if(itboost->first != key_type(itstd->first))
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user