Open
Description
The Enumerator<T>
concept currently prescribes the following usage pattern:
- zero or one
move_first
- if zero
move_first
, done - else if one
move_first
andfalse
, done - else one
move_first
andtrue
, proceed to (2)
- if zero
- zero or more
current
- zero or one
move_next
- if zero
move_next
, done - if one
move_next
andfalse
, done - else one
move_next
andtrue
, proceed to (2)
- if zero
The Enumerator<T>
concept should prescribe the following usage pattern:
- zero or one
move_first
- if zero
move_first
, done - else if one
move_first
andfalse
, zero or moremove_next
(all returningfalse
) then done - else one
move_first
andtrue
, proceed to (2)
- if zero
- zero or more
current
- zero or one
move_next
- if zero
move_next
, done - if one
move_next
andfalse
, zero or moremove_next
(all returningfalse
) then done - else one
move_next
andtrue
, proceed to (2)
- if zero
This differs from the previous semantics, which forbid calling move_next any more after having gotten a false
return from move_first
or move_next
. That previous restriction imposed by the semantics was both unnecessary and (it turns out) inconvenient. Operations like merge
, union
, intersect
, except
, etc. can be implemented with less state if this restriction is relaxed.