On Monday, 27 August 2018 at 21:48:04 UTC, Alex wrote:
On Monday, 27 August 2018 at 19:36:29 UTC, aliak wrote:
Then Nullable!(int*) would be the same as int*. Or even better
maybe is to give a compiler error when you try and stuff a
nullable type inside a Nullable. Because ... why?
Isn't
On Monday, 27 August 2018 at 19:36:29 UTC, aliak wrote:
Then Nullable!(int*) would be the same as int*. Or even better
maybe is to give a compiler error when you try and stuff a
nullable type inside a Nullable. Because ... why?
Isn't it arguable, whether this is desired? I mean, in the
On Monday, 27 August 2018 at 14:11:32 UTC, SG wrote:
On Monday, 27 August 2018 at 13:02:28 UTC, rikki cattermole
wrote:
So Nullable in D and C# is basically the same except C#'s has
language support.
The big difference is that in there I could do:
int? i = null;
string j = null;
var
On Monday, 27 August 2018 at 14:11:32 UTC, SG wrote:
On Monday, 27 August 2018 at 13:02:28 UTC, rikki cattermole
wrote:
So Nullable in D and C# is basically the same except C#'s has
language support.
Shouldn't it be in the standard library?
I think it's worth it to create a feature request
On Monday, 27 August 2018 at 13:02:28 UTC, rikki cattermole wrote:
So Nullable in D and C# is basically the same except C#'s has
language support.
The big difference is that in there I could do:
int? i = null;
string j = null;
var k = null;
and test all like:
i == null;
j
On Monday, 27 August 2018 at 12:54:59 UTC, SG wrote:
On Monday, 27 August 2018 at 03:21:04 UTC, rikki cattermole
wrote:
Templates make it the easiest way, since common patterns, like
arrays, classes and pointers have the exact same null check
syntax.
I see.
That code is only for classes. C#
On 28/08/2018 12:54 AM, SG wrote:
The same thing for struct in C#
Struct S{
public int? i;
}
S.i == null; // This works nicely.
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/nullable-types/index
So Nullable in D and C# is basically the same except C#'s has language
On Monday, 27 August 2018 at 03:21:04 UTC, rikki cattermole wrote:
Templates make it the easiest way, since common patterns, like
arrays, classes and pointers have the exact same null check
syntax.
I see.
That code is only for classes. C# also has structs which are a
value type. Which it
On 27/08/2018 12:51 PM, SG wrote:
On Sunday, 26 August 2018 at 16:39:53 UTC, rikki cattermole wrote:
UFCS function called isNull.
e.g.
import std.traits : isPointer;
bool isNull(T)(T value) if (is(T == class) || isPointer!T) {
return value is null;
}
Hi Rikki,
I'm still confused, I
On Sunday, 26 August 2018 at 16:39:53 UTC, rikki cattermole wrote:
UFCS function called isNull.
e.g.
import std.traits : isPointer;
bool isNull(T)(T value) if (is(T == class) || isPointer!T) {
return value is null;
}
Hi Rikki,
I'm still confused, I want to create a extension for
Hi again,
The code below works for some cases but not for the Nullable!Type.
A way to fix it should be check the type and use ".isNull" for
Nullabe!Type. But is there a simple way to test if value is null
for every case?
import std.stdio, std.typecons, std.variant, std.conv;
bool foo(T)(T
On 27/08/2018 4:37 AM, SG wrote:
Hi again,
The code below works for some cases but not for the Nullable!Type.
A way to fix it should be check the type and use ".isNull" for
Nullabe!Type. But is there a simple way to test if value is null for
every case?
import std.stdio, std.typecons,
12 matches
Mail list logo