The year is 2019

Manu turkeyman at gmail.com
Sat Jul 27 05:09:18 UTC 2019


On Fri, Jul 26, 2019 at 9:30 PM Mike Franklin via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Saturday, 27 July 2019 at 04:15:38 UTC, XavierAP wrote:
>
> > I think struct inheritance (with no virtual dispatch) may be
> > good for D. Has no one ever tried a DIP?
>
> I'm formulating one, but I haven't gotten very far yet.  Others
> have also mentioned interest.

I would love to see this. Please do it.

> Walter is quite opposed to
> implicit casting (https://github.com/dlang/dmd/pull/10161) so I
> was thinking of a different strategy that would use keep the
> implicit casting feature of `alias this` but defer the forwarding
> to members to D's metaprogramming facilities.

The obvious counterpart to `@implicit` constructors is probably
`@implicit` cast operators.
Those aren't quite the same as "alias this stuff into 'this' scope",
and at that very specific semantic, I think `alias this` is
occasionally useful, but if you're just trying to emulate implicit
construction or implicit casting, then I think there are better and
more deliberate ways to do that, possibly with `@implicit`.


More information about the Digitalmars-d mailing list