implicit conversions between array and pointer

Janice Caron caron800 at googlemail.com
Fri Apr 25 13:01:46 PDT 2008


On 25/04/2008, terranium <terranium at yandex.ru> wrote:
> int* p;
>  int[] a=[1,2,3];
>  p=a;
>
>  spec says it should compile, but it won't. Where is the bug - in spec or in compiler.

If I had to guess, I'd say the spec is wrong. It's a narrowing
conversion. Data is lost. To mind, that means it ought to require an
explicit cast.



More information about the Digitalmars-d mailing list