Open CaseyCarter opened 6 years ago
Shouldn't filter_view
's requirement go further? In order to achieve the amortized O(1) requirement of the increment of its iterator, the predicate shouldn't look at salient properties of the values being iterated, or filter_view
should always be an input range. Consider v | filter(is_even)
, which currently satisfies bidirectional_range
; it doesn't provide amortized O(1) iteration, so it doesn't model it (nor forward_range
).
Shouldn't
filter_view
's requirement go further?
The same can apply to istream_view
.
E.g.,
filter_view
,transform_view
. If the functions these views invoke in their iterator operations aren't required to have O(1) complexity, then the view's iterators necessarily can't provide the O(1) complexity guarantee. See https://stackoverflow.com/questions/53341822/ for an example.