18-Jun-2014 23:36, H. S. Teoh via Digitalmars-d пишет:
Here's a first stab at a library solution:
[snip]
The only wart I can see currently is the "Maybe(null)" appearing in the writeln output, instead of just "null", but that can be worked around by implementing a toString method in the Maybe struct that forwards to the wrapped type's toString method (or something along those lines). Anyway, this is just a first shot at it. You can probably build something more sophisticated out of it. :)
And most importantly make a pull request! -- Dmitry Olshansky
