Solving the impossible?

bauss jj_1337 at live.dk
Tue Aug 28 19:32:02 UTC 2018


On Tuesday, 28 August 2018 at 19:09:38 UTC, Everlast wrote:
> On Tuesday, 28 August 2018 at 12:00:50 UTC, bauss wrote:
>> On Sunday, 26 August 2018 at 02:26:58 UTC, Everlast wrote:
>>> in fact, I'd rather see
>>>
>>> void print(T)(T t, int... a)
>>
>> You were actually close.
>>
>> void print(T)(T t, int[] a ...);
>
> Yeah, I see the link paul posted. The actual syntax seems a bit 
> strange to me...
>
> We don't do
>
> A[] a ....
>
> So it is not "logical".
>
> foo(A...)(A a)
>
> but if A is a specific type we must do
>
> foo(int[] a ...)
>
> The actual syntax then looks like we have an variadic set of 
> parameters of type int[] rather than int.

Yeah I agree with that, but unfortunately it cannot be changed.


More information about the Digitalmars-d-learn mailing list