RFP - name for input range method

Steven Schveighoffer schveiguy at gmail.com
Thu Apr 2 15:31:32 UTC 2020


On 4/2/20 10:09 AM, Steven Schveighoffer wrote:
> The migration process would be:
> 
> 1. Add method(s) for input ranges that support being able to correctly 
> "destructively copy" the range. This allows an opt-in for simple copying 
> when you know that the original is destroyed. You can use `move` otherwise.
> 2. Deprecate save, and deprecate input ranges that allow simple copying, 
> but don't define these methods.
> 3. Remove save, change classification of ranges that allow simple 
> copying to forward ranges.
> 4. Profit


better:

1. same as above.
2. Deprecate copying input ranges, directing the user to use the new 
methods. It might be useful to have compiler help for this. If a range 
defines `save`, it is a forward range still. If a range allows copying 
but does not define `save`, then a deprecation message is displayed via 
`isInputRange`.
3. Interpret ranges that are copyable as forward ranges. Deprecate save
4. Remove save.
5. Profit

-Steve


More information about the Digitalmars-d mailing list