
Hi, though the document says the boost permutation_iterator base returns an element iterator, but it seems actually returns the index iterator. eg, typedef std::vector<int> VI;///index iterator VI v; v+=1,3,4;///indices typedef std::vector<double> VF;///element iterator VF v1; v1+=0.5,1.5,2.5,3.5,4.5,5.5,6.5,7.5;///elements typedef boost::permutation_iteratorVF::iterator,VI::iterator PI; PI b1 = boost::make_permutation_iterator(v1.begin(),v.begin()); PI e1 = boost::make_permutation_iterator(v1.begin(),v.end()); for(PI it = b1; it!= e1; ++it){ std::cout<<"IT "<<*it<<" B "<<*it.base()<<" "; } what i need is to compare the permutation iterator with an original iterator (i.e VF::iterator with PI like if(v1.begin()+1 == b1) or if(v1.begin()+1 == b1.base()) in this case which should return true) but i am not finding any such way to compare these two iterators .... thanks abir