Request: a more logical static array behavior

Maxim Fomin maxim at maxim-fomin.ru
Thu Aug 15 07:53:06 PDT 2013


On Thursday, 15 August 2013 at 14:32:29 UTC, Tommi wrote:
>
> No it's not:
>
> void getLong(T)(T arg)
> if (is(T : long))
> {
>     static assert(is(typeof(arg) == int));
> }
>
> void main()
> {
>     int n;
>     getLong(n); // int is _not_ implicitly converted to long
> }

Yes, because during type deduction there was constraint test that 
checked whether int is convertible to long which is the same 
story as in static-dynamic array case.


More information about the Digitalmars-d mailing list