High cost sometime if filtered always store dereferenced-value.
I think memoized adaptor was better to external store design. or add
stored_filtered adaptor.
2011/6/1 Akira Takahashi
Nate, follow is filtered + transformed adaptor's internal behavior.
[filtered] increment iterator behavior: while (!pred(*it)) ++it;
dereference iterator behavior: *it;
[transformed] increment iterator behavior: ++it;
dereference iterator behavior: f(*it);
[filtered | transformed] increment iterator behavior: while (!pred(*it)) ++it;
dereference iterator behavior: f(*it);
[transformed | filtered] increment iterator behavior: while (!pred(f(*it))) ++it;
dereference iterator behavior: f(*it);
oven::memoized is call once function by stored calculation.
2011/6/1 Nathan Ridge
: Thanks Akira, it is good to know that there is a workaround.
But I was wondering, is it necessary in the first place for filtered to dereference the underlying range elements twice?
Thanks, Nate.
======================== Akira Takahashi mailto:faithandbrave@gmail.com blog:http://d.hatena.ne.jp/faith_and_brave/