On Thursday, 24 May 2018 at 07:37:40 UTC, Sjoerd Nijboer wrote:
On Thursday, 24 May 2018 at 07:06:03 UTC, Bastiaan Veelo wrote:
On Thursday, 24 May 2018 at 06:42:51 UTC, Sjoerd Nijboer wrote:
On Thursday, 24 May 2018 at 01:39:56 UTC, Jonathan M Davis
wrote:
If you don't want an implict cast, th
On Thursday, 24 May 2018 at 07:06:03 UTC, Bastiaan Veelo wrote:
On Thursday, 24 May 2018 at 06:42:51 UTC, Sjoerd Nijboer wrote:
On Thursday, 24 May 2018 at 01:39:56 UTC, Jonathan M Davis
wrote:
If you don't want an implict cast, then why did you declare
an alias this?
Because I wanted an inco
On Thursday, 24 May 2018 at 06:42:51 UTC, Sjoerd Nijboer wrote:
On Thursday, 24 May 2018 at 01:39:56 UTC, Jonathan M Davis
wrote:
If you don't want an implict cast, then why did you declare an
alias this?
Because I wanted an inconvertible type which was exactly like
the int in the example but
On Thursday, 24 May 2018 at 01:39:56 UTC, Jonathan M Davis wrote:
If you don't want an implict cast, then why did you declare an
alias this?
Because I wanted an inconvertible type which was exactly like the
int in the example but didn't want the implicit cast.
That's the whole point of alias
On Thursday, May 24, 2018 00:30:03 Sjoerd Nijboer via Digitalmars-d wrote:
> While tinkering with some code I eventually found that the
> following didn't do as I expected
>
> import std.conv;
> import std.stdio;
>
> void main()
> {
> Foo foo = 5;
> writeln(foo);
> }
>
> struct Foo{
>
I would REALLY love a way to implement an implicit cast that
wasn't `alias this` based... for reasons that are NOT to
@disable it :P
Well, explicit casts can be annoying at times when type
conversion wouldn't mean loss of precision, but disabling an
implicit cast on any type that has such c
On Thursday, 24 May 2018 at 00:53:00 UTC, Manu wrote:
I would REALLY love a way to implement an implicit cast that
wasn't `alias this` based... for reasons that are NOT to
@disable it :P
Well, explicit casts can be annoying at times when type
conversion wouldn't mean loss of precision, but di
On 23 May 2018 at 17:30, Sjoerd Nijboer via Digitalmars-d
wrote:
> While tinkering with some code I eventually found that the following didn't
> do as I expected
>
> import std.conv;
> import std.stdio;
>
> void main()
> {
> Foo foo = 5;
> writeln(foo);
> }
>
> struct Foo{
> int i;
>
While tinkering with some code I eventually found that the
following didn't do as I expected
import std.conv;
import std.stdio;
void main()
{
Foo foo = 5;
writeln(foo);
}
struct Foo{
int i;
alias i this;
@disable T opCast(T)();
this(int j)
{i =j;}
}
If the cast in