4 ms·
This isn’t just a problem with custom types, it affects generic iteration types too. With a next() -> Option<T> method, an Iterator can iterate over any type of
by DougBTX 3y ago
This isn’t just a problem with custom types, it affects generic iteration types too. With a next() -> Option<T> method, an Iterator can iterate over any type of element.
- cubefox 3y agoYeah, but there could be a type T for "any type" additional to union types, basically like TRUE in Boolean logic. (Theoretically you could also have F for "no type", intersection types (AND), negation types (not Foo), and any logical complex of those.)