DIP Mir1 Draft: Variadic template parameters with the same time.

Ilya Yaroshenko via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 29 14:39:09 PDT 2016


On Thursday, 29 September 2016 at 21:31:11 UTC, Timothee Cour 
wrote:
> maybe remove the corresponding DIP from 
> https://github.com/libmir/mir/wiki/Compiler-and-druntime-bugs#dips ?
>
> On Thu, Sep 29, 2016 at 2:19 PM, Ilya Yaroshenko via 
> Digitalmars-d < digitalmars-d at puremagic.com> wrote:
>
>> On Thursday, 29 September 2016 at 21:06:13 UTC, Timothee Cour 
>> wrote:
>>
>>> this works:
>>>
>>> void foo(T, size_t n)(T[n] a ...) {...}
>>>
>>> However, see this: https://github.com/libmir/mir/issues/337
>>>
>>>
>>> On Thu, Sep 29, 2016 at 1:57 PM, Ilya Yaroshenko via 
>>> Digitalmars-d < digitalmars-d at puremagic.com> wrote:
>>>
>>> On Thursday, 29 September 2016 at 20:54:12 UTC, Ilya 
>>> Yaroshenko wrote:
>>>>
>>>> On Thursday, 29 September 2016 at 20:47:35 UTC, Andrei 
>>>> Alexandrescu
>>>>>[...]
>>>> I am sorry for my terrible English (i am in a dark room now)
>>>>
>>>
>> Thanks! ag0aep6g have suggested the same. I am confused that I 
>> did know this solution. Will open separate thread for 
>> https://github.com/libmir/mir/issues/337.

Just found an example, where this approach does not work :-(

template transposed(Dimensions...)
     if (Dimensions.length)
{
     Slice!(N, Range) transposed(size_t N, Range)(auto ref 
Slice!(N, Range) slice)
     {
         ...
     }
}


More information about the Digitalmars-d mailing list