The year is 2019

Manu turkeyman at gmail.com
Sat Jul 27 22:25:53 UTC 2019


On Sat, Jul 27, 2019 at 9:15 AM 12345swordy via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Saturday, 27 July 2019 at 09:04:45 UTC, Mike Franklin wrote:
>
> > I would be perfectly happy with `opImiplicitCast` or some way
> > to have implicit constructors.  But Walter has already voiced
> > his disapproval of that (See the comments in
> > https://github.com/dlang/dmd/pull/10161 for the
> > disappointment), so our choices are getting slim.  I'm trying
> > to find something he would be willing to approve. If you have
> > any ideas, I'm all ears.
> >
> > Mike
>
> We shouldn't let Walter disapproval effect us. If we think it a
> really good idea then we should pursuit it.
>
> Walter thinks the opImplicitCast that we are proposing will be
> the same thing as C++. It isn't. C++ genius "idea" is to have
> implicit conversions opt-out rather then opt-in.
>
> -Alex

Right, the big difference is that implicit casting is opt-in. It would
only be used when it makes good sense, and not by accident.
I still think @implicit applied to normal copy constructors and/or
opCast is the best way though. That way the attribute can be extended
in the future if it makes sense to expand, specifically on copy
constructors where the function doesn't have a proper name.


More information about the Digitalmars-d mailing list