ndslice: feature deprecation voting / discussion

rikki cattermole via Digitalmars-d digitalmars-d at puremagic.com
Sun Oct 2 07:23:02 PDT 2016


On 03/10/2016 3:02 AM, Ilya Yaroshenko wrote:
> Timothee Cour proposed to deprecate arguments without [ ... ] that
> represent shape .
>
>   auto a0=iota(3*4).sliced(3,4); // proposal:deprecate
>   auto a1=iota(3*4).sliced([3,4]);
>   auto a2=iotaSlice(3,4); // proposal:deprecate
>   auto a3=iotaSlice([3,4]);
>   auto a6=slice!int(3,4);// proposal:deprecate
>   auto a4=slice!int([3,4]);
>
>   ... the same for blocks, windows, ... etc.
>
> Mir Issue: https://github.com/libmir/mir/issues/337
>
> Current Yes: Timothee Cour, John Colvin
> Current No : Ilya Yaroshenko, Relja Ljubobratovic
>
> If you want to see the code please use Phobos code (not Mir). Template
> bloat was significantly reduced in
> https://github.com/dlang/phobos/pull/4823.
>
> Ilya

Will dmd store void func(int[]), func([1, 2]) the array onto the stack?
If it doesn't then T[] v... would be better which will accept both.

It also won't increase template bloat.

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



More information about the Digitalmars-d mailing list