Re: Is Nullable supposed to provide Optional semantics?

2018-01-13 Thread Chris Paulson-Ellis via Digitalmars-d-learn
On Saturday, 30 December 2017 at 19:11:05 UTC, Steven Schveighoffer wrote: Please file a bug report. Sorry for the delay - stuff happened. I reopened an existing bug that I found: https://issues.dlang.org/show_bug.cgi?id=17440

Re: Is Nullable supposed to provide Optional semantics?

2017-12-30 Thread Chris Paulson-Ellis via Digitalmars-d-learn
On Friday, 29 December 2017 at 22:08:59 UTC, vit wrote: n = Nullable!Object.init; assert(n.isNull == true); [...] more: https://forum.dlang.org/thread/jrdedmxnycbqzcpre...@forum.dlang.org?page=1 Thanks. No-one in the linked thread seemed to know why .destroy is used in nullify.

Re: Is Nullable supposed to provide Optional semantics?

2017-12-29 Thread Chris Paulson-Ellis via Digitalmars-d-learn
On Friday, 29 December 2017 at 21:34:27 UTC, vit wrote: use: n = Nullable!Object.init; //doesn't call destroy instead of: n.nullify(); Only nullify() can make isNull return true again. I need that semantic.

Is Nullable supposed to provide Optional semantics?

2017-12-29 Thread Chris Paulson-Ellis via Digitalmars-d-learn
I've been bitten by trying to use Nullable(T) on class types. Minimal example... import std.typecons : Nullable; void main() { auto o = new Object(); o.toString(); Nullable!Object n = o; o.toString(); n.nullify(); o.toString(); // SegV! } The SEGV is caused by