On Wednesday, 29 March 2023 at 19:49:47 UTC, Ali Çehreli wrote:
I thought Salih was proposing two more overloads to the existing put(). When I copy the existing put(), which takes 'ref R', not R[], then the code does not compile:

auto put(R)(R[] range, R[] source)
  => putImpl(range, source);

auto put(R)(ref R[] range, R[] source)
  => putImpl(range, source);

[...]

void put(R, E)(ref R r, E e)
{
  // This is from Phobos <-------
}

I understand Salih's ref `put` to be same as yours: a stand-in for the one that is already in Phobos. So he's proposing to add the non-ref one.

But regardless of Salih's exact intent, the broader point is: a non-ref overload could be added to Phobos. And that would enable `a[1..$-1].phobos_put([2, 3])`. Which is what he asked about originally.
  • The Phobos Put Salih Dincer via Digitalmars-d-learn
    • Re: The Phobos Put Dennis via Digitalmars-d-learn
      • Re: The Phobos Put Ali Çehreli via Digitalmars-d-learn
        • Re: The Phobos P... Salih Dincer via Digitalmars-d-learn
          • Re: The Phob... Ali Çehreli via Digitalmars-d-learn
            • Re: The... ag0aep6g via Digitalmars-d-learn
              • Re:... Ali Çehreli via Digitalmars-d-learn
                • ... ag0aep6g via Digitalmars-d-learn
                • ... Salih Dincer via Digitalmars-d-learn
                • ... Steven Schveighoffer via Digitalmars-d-learn
                • ... Salih Dincer via Digitalmars-d-learn
                • ... Steven Schveighoffer via Digitalmars-d-learn
                • ... Salih Dincer via Digitalmars-d-learn
                • ... Paul Backus via Digitalmars-d-learn
                • ... Steven Schveighoffer via Digitalmars-d-learn
                • ... Paul Backus via Digitalmars-d-learn
                • ... Salih Dincer via Digitalmars-d-learn

Reply via email to