Suggestion: Remove implicit conversion from T[n] and T[] to T*

Walter Bright newshound at digitalmars.com
Mon Dec 4 00:13:10 PST 2006


Bill Baxter wrote:
> Walter Bright wrote:
>> Oskar Linde wrote:
>>> Removing the implicit conversion from static arrays (T[n]) and 
>>> dynamic arrays (T[]) to pointers T* may be quite controversial, but 
>>> would help clear up some problems and feels like the right step to take.
>>
>> Looks like that implicit cast is going down in flames!
> 
> Suggestion: could you make it a compiler flag for the next release so we 
> can try it out on our own code?  I for one have no idea how much pain 
> the change will cause me.  I'm vaguely for it, since .ptr isn't that 
> much to type, and generally I prefer explicit to implicit, but that's 
> only if the pain involved is not too great.

That's a good idea, but I suggest reversing it. Make the change, with a 
switch to revert it back. That way, you won't have to change your makefiles.



More information about the Digitalmars-d mailing list