DIP Mir1 Draft: Variadic template parameters with the same time.
Ilya Yaroshenko via Digitalmars-d
digitalmars-d at puremagic.com
Thu Sep 29 12:08:26 PDT 2016
On Thursday, 29 September 2016 at 19:03:00 UTC, pineapple wrote:
> On Thursday, 29 September 2016 at 18:56:40 UTC, Ilya Yaroshenko
> wrote:
>> No, it does not
>> ---
>> void foo(size_t[] I...)(I i)
>> {
>>
>> }
>
> Using phobos' allSatisfy or a similar template, this can become:
>
> enum isIndex(T) = is(T == size_t);
> void foo(I...)(I i) if(allSatisfy!(isIndex, I)){ ... }
would not work:
auto v = cube[1, 2, 3];
More information about the Digitalmars-d
mailing list