string and char[]

Simen kjaeraas simen.kjaras at gmail.com
Fri Apr 8 04:04:36 PDT 2011


On Fri, 08 Apr 2011 13:01:41 +0200, simendsjo <simen.endsjo at pandavre.com>  
wrote:

>> It is a mistake to use non-immutable keys for an associative array.
>
> But a string literal isn't mutable..?

This is correct. I'm referring to line 1, int[char[]] asr;. This
declaration is wrong, and should be rejected by the compiler.

Also note that I'm saying non-immutable. const is not good enough, as it
may come from a mutable source.


-- 
Simen


More information about the Digitalmars-d mailing list