DIP 1016--ref T accepts r-values--Community Review Round 1

Manu turkeyman at gmail.com
Fri Jul 20 17:48:55 UTC 2018


On Fri, 20 Jul 2018 at 04:50, Seb via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Friday, 20 July 2018 at 05:16:53 UTC, Mike Parker wrote:
> > This is the feedback thread for the first round of Community
> > Review for DIP 1016, "ref T accepts r-values":
> >
> > https://github.com/dlang/DIPs/blob/725541d69149bc85a9492f7df07360f8e2948bd7/DIPs/DIP1016.md
> >
> > All review-related feedback on and discussion of the DIP should
> > occur in this thread. The review period will end at 11:59 PM ET
> > on August 3, or when I make a post declaring it complete.
> >
> > At the end of Round 1, if further review is deemed necessary,
> > the DIP will be scheduled for another round. Otherwise, it will
> > be queued for the Final Review and Formal Assessment by the
> > language maintainers.
> >
> > Please familiarize yourself with the documentation for the
> > Community Review before participating.
> >
> > https://github.com/dlang/DIPs/blob/master/PROCEDURE.md#community-review
> >
> > Thanks in advance to all who participate.
>
> I like this too. Solid work!
>
> One minor point: the DIP could mentioned structs with disabled
> postblits (it currently only tangentially touches it by stating
> that no copy operation should happen).
> It would be great to make sure that this will work:
>
> ---
> struct A
> {
>      int i;
>      @disable this(this);
> }
>
> void fun(ref A x);
> void test()
> {
>      fun(A(42));
> }
> ---

Can I get a second opinion on this?
I think it's implicit that this works (ref args do not copy), and I
don't think an unrelated thing (copy construction) needs to be made
explicit here.


More information about the Digitalmars-d mailing list