On 3/29/23 4:29 PM, ag0aep6g wrote:

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.

I think the idea of requiring ref output ranges is that you can then let the range keep track of its output state.

An input range with lvalue elements is therefore an output range, but only if it's accepted via ref, since it has to be iterated as it goes. If you iterate it only internally, then it's either in an undetermined state when you exit `put`, or it is a forward range that was copied without using `save`.

It's not the greatest situation. I feel like we probably shouldn't have made lvalue input ranges be output ranges automatically.

-Steve
  • 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