Does anyone care if Tuple.slice() returns by ref?

tsbockman via Digitalmars-d digitalmars-d at puremagic.com
Sun Feb 7 15:28:29 PST 2016


On Sunday, 7 February 2016 at 16:49:16 UTC, Ola Fosheim Grøstad 
wrote:
> On Sunday, 7 February 2016 at 16:27:32 UTC, Saurabh Das wrote:
>> Why is the design flawed?
>
> Because it breaks expectations.
>
> Tuples should be builtin and the primarily use case is 
> supporting multiple return values with heavy duty register 
> optimization.

The fact that `Tuple` cannot implement `opIndex` or `opSlice`, 
but instead must use the non-standard `slice` name is a good 
indicator that the current design is less than ideal.


More information about the Digitalmars-d mailing list