30 Aug
2007
30 Aug
'07
3:04 a.m.
In experimenting with boost::multi_index, I find that std::distance does not work properly multi_index iterators. My multi_index as a single ordered index for now, and I've tried: C cs; Index& index = cs.get<0>(); ... populate cs Index::iterator iter=index.find(7); cout << "distance is \"" << distance(cs.begin(),iter) << "\"" << endl; cout << "distance is \"" << distance(index.begin(),iter) << "\"" endl; Both outputs print that the distance is 0, and should be 7. Note both output lines compile and I've also tried using operator- and operator+ with the iterators and found that they don't exist (as expected). Is there a work around for this?