Infinite range of nullable elements

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 17 03:19:20 PDT 2015


On Friday, 17 July 2015 at 07:42:09 UTC, Roland Hadinger wrote:
> At this moment I'm tempted to implement a function taking a 
> range of elements E and returning an infinite range of 
> Nullable!E.
>
> [...]

Wouldn't it still require the algorithms to check if an element 
isNull()? Calling get() on a null element will assert().

I'm wondering why it asserts instead of throwing.


More information about the Digitalmars-d-learn mailing list