DIP Mir1 Draft: Variadic template parameters with the same time.
Ilya Yaroshenko via Digitalmars-d
digitalmars-d at puremagic.com
Thu Sep 29 13:54:12 PDT 2016
On Thursday, 29 September 2016 at 20:47:35 UTC, Andrei
Alexandrescu wrote:
> Ilya Yaroshenko <ilyayaroshenko at gmail.com> wrote:
>> On Thursday, 29 September 2016 at 18:55:07 UTC, Andrei
>> Alexandrescu wrote:
>>> On 09/29/2016 02:53 PM, Ilya Yaroshenko wrote:
>>>> `(Index...)` -> `(size_t[] Index...)` // this is about
>>>> template
>>>> arguments, not runtime
>>>
>>> What is the drawback of taking Index... and constraining it
>>> with a template constraint (all must be integral)? We use
>>> that in a few places in Phobos. -- Andrei
>>
>> This is the same like in current ndslice code.
>> For 3D cube[i, j, k] 64(!) templates can be generated because
>> each of i, j, k can be int, uint, size_t, sizediff_t.
>>
>
> Yah, I remember. Can you experiment with arranging things such
> that all templates forward to the same backend function that
> does the work?
This already done. But anyway lot of template bloat would note
disappeared. In addition there are inlining and mapSlice
More information about the Digitalmars-d
mailing list