Rename parameters to avoid confusion when debugging.

This commit is contained in:
Ion Gaztañaga
2015-02-26 00:17:57 +01:00
parent 012781cc94
commit d0750f4493

View File

@@ -59,22 +59,26 @@ bool CheckEqual( const Pair1 &pair1, const Pair2 &pair2
} }
//Function to check if both containers are equal //Function to check if both containers are equal
template<class MyBoostCont template<class ContA
,class MyStdCont> ,class ContB>
bool CheckEqualContainers(const MyBoostCont &boostcont, const MyStdCont &stdcont) bool CheckEqualContainers(const ContA &cont_a, const ContB &cont_b)
{ {
if(boostcont.size() != stdcont.size()) if(cont_a.size() != cont_b.size())
return false; return false;
typename MyBoostCont::const_iterator itboost(boostcont.begin()), itboostend(boostcont.end()); typename ContA::const_iterator itcont_a(cont_a.begin()), itcont_a_end(cont_a.end());
typename MyStdCont::const_iterator itstd(stdcont.begin()); typename ContB::const_iterator itcont_b(cont_b.begin()), itcont_b_end(cont_b.end());;
typename MyStdCont::size_type dist = (typename MyStdCont::size_type)boost::container::iterator_distance(itboost, itboostend); typename ContB::size_type dist = (typename ContB::size_type)boost::container::iterator_distance(itcont_a, itcont_a_end);
if(dist != boostcont.size()){ if(dist != cont_a.size()){
return false;
}
typename ContA::size_type dist2 = (typename ContA::size_type)boost::container::iterator_distance(itcont_b, itcont_b_end);
if(dist2 != cont_b.size()){
return false; return false;
} }
std::size_t i = 0; std::size_t i = 0;
for(; itboost != itboostend; ++itboost, ++itstd, ++i){ for(; itcont_a != itcont_a_end; ++itcont_a, ++itcont_b, ++i){
if(!CheckEqual(*itstd, *itboost)) if(!CheckEqual(*itcont_a, *itcont_b))
return false; return false;
} }
return true; return true;