On Tuesday, June 30, 2015 14:29:52 Steven Schveighoffer via Digitalmars-d-learn
wrote:
I know this is just back-of-envelope, but what's wrong with:
alias Nullable(T) if(is(T == class)) = T;
bool isNull(T)(T t) if(is(T == class)) { return t is null;}
In principle, there's no reason why we
On Tuesday, 30 June 2015 at 18:29:31 UTC, Steven Schveighoffer
wrote:
I know this is just back-of-envelope, but what's wrong with:
alias Nullable(T) if(is(T == class)) = T;
bool isNull(T)(T t) if(is(T == class)) { return t is null;}
That's what I intended. (Same for pointers and slices,
On 7/1/15 5:45 AM, Marc =?UTF-8?B?U2Now7x0eiI=?= schue...@gmx.net wrote:
On Tuesday, 30 June 2015 at 18:29:31 UTC, Steven Schveighoffer wrote:
I know this is just back-of-envelope, but what's wrong with:
alias Nullable(T) if(is(T == class)) = T;
bool isNull(T)(T t) if(is(T == class)) { return
On 7/1/15 5:45 AM, Marc =?UTF-8?B?U2Now7x0eiI=?= schue...@gmx.net wrote:
On Tuesday, 30 June 2015 at 18:29:31 UTC, Steven Schveighoffer wrote:
I know this is just back-of-envelope, but what's wrong with:
alias Nullable(T) if(is(T == class)) = T;
bool isNull(T)(T t) if(is(T == class)) { return
On Wednesday, July 01, 2015 08:43:59 Steven Schveighoffer via
Digitalmars-d-learn wrote:
On 7/1/15 5:45 AM, Marc =?UTF-8?B?U2Now7x0eiI=?= schue...@gmx.net wrote:
On Tuesday, 30 June 2015 at 18:29:31 UTC, Steven Schveighoffer wrote:
I know this is just back-of-envelope, but what's wrong with:
On Tuesday, 30 June 2015 at 15:17:00 UTC, Jonathan M Davis wrote:
I tend to think that it's incredibly stupid to use something
like Nullable for a type that's already Nullable.
Unfortunately, we're stuck with it as changing that would break
code.
It's just silly. If a type is already
On Tuesday, 30 June 2015 at 00:02:38 UTC, Meta wrote:
On Monday, 29 June 2015 at 19:29:37 UTC, sigod wrote:
Hi, everyone.
```
import std.typecons : Nullable;
class Test {}
Nullable!Test test;
assert(test.isNull);
```
Why does `Nullable` allowed to be used with reference types
(e.g.
On Tuesday, 30 June 2015 at 00:02:38 UTC, Meta wrote:
It's a design mistake in Nullable. I would suggest that either
never use Nullable with a type that already has a null value,
or use the overload of Nullable that takes a null value, and
set it to null. Example:
Class Test {}
alias
On Tuesday, 30 June 2015 at 11:50:19 UTC, Marc Schütz wrote:
On Tuesday, 30 June 2015 at 00:02:38 UTC, Meta wrote:
It's a design mistake in Nullable. I would suggest that either
never use Nullable with a type that already has a null value,
or use the overload of Nullable that takes a null
On Monday, 29 June 2015 at 19:29:37 UTC, sigod wrote:
Hi, everyone.
```
import std.typecons : Nullable;
class Test {}
Nullable!Test test;
assert(test.isNull);
```
Why does `Nullable` allowed to be used with reference types
(e.g. classes)?
P.S. I have experience with C#, where `NullableT`
On Monday, 29 June 2015 at 19:29:37 UTC, sigod wrote:
Hi, everyone.
```
import std.typecons : Nullable;
class Test {}
Nullable!Test test;
assert(test.isNull);
```
Why does `Nullable` allowed to be used with reference types
(e.g. classes)?
P.S. I have experience with C#, where `NullableT`
Hi, everyone.
```
import std.typecons : Nullable;
class Test {}
Nullable!Test test;
assert(test.isNull);
```
Why does `Nullable` allowed to be used with reference types (e.g.
classes)?
P.S. I have experience with C#, where `NullableT` cannot be
used with reference types. And it sounds
On 6/30/15 11:16 AM, Jonathan M Davis wrote:
On Tuesday, 30 June 2015 at 00:02:38 UTC, Meta wrote:
On Monday, 29 June 2015 at 19:29:37 UTC, sigod wrote:
Hi, everyone.
```
import std.typecons : Nullable;
class Test {}
Nullable!Test test;
assert(test.isNull);
```
Why does `Nullable` allowed
13 matches
Mail list logo