Re: Comparison of struct with Nullable member

2015-07-17 Thread anonymous via Digitalmars-d-learn
On Friday, 17 July 2015 at 12:18:56 UTC, TC wrote: Hello, I came around a strange behavior and I'm not sure if it is a bug or feature. import std.typecons : Nullable; struct Foo { string bar; Nullable!int baz; } auto a = Foo("bb"); auto b = Foo("bb"); assert(a == b); This end

Re: Comparison of struct with Nullable member

2015-07-17 Thread Meta via Digitalmars-d-learn
On Friday, 17 July 2015 at 15:52:45 UTC, TC wrote: On Friday, 17 July 2015 at 15:30:42 UTC, Meta wrote: https://issues.dlang.org/show_bug.cgi?id=14804 I'll probably be able to submit a PR for this sometime in the next few days. Thanks. What I don't get is why this one works ok? import std.t

Re: Comparison of struct with Nullable member

2015-07-17 Thread TC via Digitalmars-d-learn
On Friday, 17 July 2015 at 15:30:42 UTC, Meta wrote: https://issues.dlang.org/show_bug.cgi?id=14804 I'll probably be able to submit a PR for this sometime in the next few days. Thanks. What I don't get is why this one works ok? import std.typecons : Nullable; struct Foo { int bar;

Re: Comparison of struct with Nullable member

2015-07-17 Thread Meta via Digitalmars-d-learn
On Friday, 17 July 2015 at 12:18:56 UTC, TC wrote: Hello, I came around a strange behavior and I'm not sure if it is a bug or feature. import std.typecons : Nullable; struct Foo { string bar; Nullable!int baz; } auto a = Foo("bb"); auto b = Foo("bb"); assert(a == b); This end

Re: Comparison of struct with Nullable member

2015-07-17 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 17 July 2015 at 12:18:56 UTC, TC wrote: Hello, I came around a strange behavior and I'm not sure if it is a bug or feature. import std.typecons : Nullable; struct Foo { string bar; Nullable!int baz; } auto a = Foo("bb"); auto b = Foo("bb"); assert(a == b); This end

Comparison of struct with Nullable member

2015-07-17 Thread TC via Digitalmars-d-learn
Hello, I came around a strange behavior and I'm not sure if it is a bug or feature. import std.typecons : Nullable; struct Foo { string bar; Nullable!int baz; } auto a = Foo("bb"); auto b = Foo("bb"); assert(a == b); This ends up with: Called `get' on null Nullable!int But if