
11 Jan
2012
11 Jan
'12
10:11 a.m.
Hi,
2012/1/11 John M. Dlugosz
Consider something like this:
themap_type::iterator search_for (int val) { return boost::find_if (themap|map_values, my_predicate(val)); }
The return from the function chokes because the adapted iterator type cannot be convered back to the original type of iterator in the parent collection.
Adapted iterators have base() method that returns underlying iterator. For every level of adaptation just call base() on resulting iterator to get to the base one. Cheers, Simon -- Szymon Gatner The Lordz Games Studio www.thelordzgamesstudio.com