void test_const_hashed_iterators(const Index& i,int target) { typedef typename Index::const_iterator const_iterator; typedef typename Index::const_local_iterator const_local_iterator; typedef typename Index::size_type size_type; BOOST_TEST(i.cbegin()==i.begin()); BOOST_TEST(i.cend()==i.end()); int n=0; for(const_iterator it=i.begin();it!=i.end();++it){ BOOST_TEST(i.iterator_to(*it)==it); n+=it->id; } int m=0; for(size_type buc=0;buc<i.bucket_count();++buc){ BOOST_TEST(i.cbegin(buc)==i.begin(buc)); BOOST_TEST(i.cend(buc)==i.end(buc)); for(const_local_iterator it=i.begin(buc);it!=i.end(buc);++it){ BOOST_TEST(i.local_iterator_to(*it)==it); m+=it->id; } } BOOST_TEST(n==target&&n==m); }
void test_const_hashed_iterators(const Index& i,int target) { typedef typename Index::const_iterator const_iterator; typedef typename Index::const_local_iterator const_local_iterator; typedef typename Index::size_type size_type; int n=0; for(const_iterator it=i.begin();it!=i.end();++it){ n+=it->id; } int m=0; for(size_type buc=0;buc<i.bucket_count();++buc){ for(const_local_iterator it=i.begin(buc);it!=i.end(buc);++it){ m+=it->id; } } BOOST_CHECK(n==target&&n==m); }