Implement IndexedList::iterator

It is dangerous to expose internal iterator to the outside, which is
easily misused.
This commit is contained in:
Tatsuhiro Tsujikawa 2013-03-01 23:13:24 +09:00
parent 421ae13d40
commit d4ba562710
11 changed files with 583 additions and 133 deletions

View file

@ -122,10 +122,9 @@ SharedHandle<RequestGroup> getReservedGroup
(const SharedHandle<RequestGroupMan>& rgman, size_t index)
{
assert(rgman->getReservedGroups().size() > index);
RequestGroupList::SeqType::const_iterator i =
rgman->getReservedGroups().begin();
RequestGroupList::const_iterator i = rgman->getReservedGroups().begin();
std::advance(i, index);
return (*i).second;
return *i;
}
SharedHandle<RequestGroup> createRequestGroup(int32_t pieceLength,