You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But I think the Self and Item types should not be enforced, as we can find them from the signature of the next method. Also, many iterators in the standard library do not have these two associated types, or have Self named in another way, e.g. std.bit_set.IntegerBitSet.Iterator.
Instead, we can define an iterator to be a type T that has a next function, taking one parameter of type *T and returns any value of optional type.
We can check this constraint with the domain and codomain functions in src/compat.zig.
The text was updated successfully, but these errors were encountered:
The current iterator constraints are:
Self
typeItem
typenext
method takes*Self
and returns?Item
.But I think the
Self
andItem
types should not be enforced, as we can find them from the signature of thenext
method. Also, many iterators in the standard library do not have these two associated types, or haveSelf
named in another way, e.g.std.bit_set.IntegerBitSet.Iterator
.Instead, we can define an iterator to be a type
T
that has anext
function, taking one parameter of type*T
and returns any value of optional type.We can check this constraint with the
domain
andcodomain
functions insrc/compat.zig
.The text was updated successfully, but these errors were encountered: