On Thursday, 1 October 2020 at 09:49:36 UTC, Mathias LANG wrote:
Author here. The most complete way to know would be to read the changelog: https://dlang.org/changelog/2.094.0.html#preview-in The TL;DR is that, in addition to `const scope`, `in` now automatically behaves as `ref` when "it makes sense" such as large value types or presence of destructors / postblit (more details in the changelog!) and will accept rvalues, unlike other ref parameters.

Why was this added when we already have `auto ref`? Yes, it makes the function a template, but if `in` can automatically choose whether the variable is ref or not, then auto ref could easily do the same.
  • Release D 2.094.0 Martin Nowak via Digitalmars-d-announce
    • Re: Release D 2.094.0 Imperatorn via Digitalmars-d-announce
      • Re: Release D 2.0... Daniel N via Digitalmars-d-announce
        • Re: Release D... Imperatorn via Digitalmars-d-announce
          • Re: Relea... user1234 via Digitalmars-d-announce
          • Re: Relea... Mathias LANG via Digitalmars-d-announce
            • Re: ... Meta via Digitalmars-d-announce
              • ... Steven Schveighoffer via Digitalmars-d-announce
                • ... Meta via Digitalmars-d-announce
                • ... Steven Schveighoffer via Digitalmars-d-announce
                • ... Petar via Digitalmars-d-announce
                • ... Mathias LANG via Digitalmars-d-announce
                • ... Meta via Digitalmars-d-announce
                • ... kinke via Digitalmars-d-announce
                • ... Meta via Digitalmars-d-announce
                • ... Andrei Alexandrescu via Digitalmars-d-announce
                • ... Seb via Digitalmars-d-announce

Reply via email to