Voting For std.experimental.ndslice

Ilya Yaroshenko via Digitalmars-d digitalmars-d at puremagic.com
Tue Dec 29 07:59:39 PST 2015


On Tuesday, 29 December 2015 at 14:51:37 UTC, Márcio Martins 
wrote:
> On Tuesday, 29 December 2015 at 13:54:56 UTC, Jack Stouffer 
> wrote:
>> On Tuesday, 29 December 2015 at 13:30:47 UTC, Márcio Martins 
>> wrote:
>>> If I am reading the code right, the number of dimensions must 
>>> always be known at compile time, right?
>>
>> Not necessarily. The dimensions for this slice are computed at 
>> runtime.
>>
>> ```
>> auto slice = 1000.iota.sliced(5, 6, 7);
>> ```
>
> ```
>
> With this declaration:
>
> ```
> struct Slice(size_t _N, _Range)
> ```
> _N, the number of dimensions, must necessarily be known at 
> compile-time, right?

Yes. -- Ilya


More information about the Digitalmars-d mailing list