Associative arrays can't have a static array as key

Tomas Lindquist Olsen tomas at famolsen.dk
Thu Feb 8 07:07:47 PST 2007


Jarrett Billingsley wrote:

> "Michiel" <nomail at hotmail.com> wrote in message
> news:eqfctr$69r$1 at digitaldaemon.com...
> 
>> But putting that aside for the moment, how can I convince D to
>> automatically
>> make it a dynamic array, so I can use my function?
> 
> foo("blah"[]);
> 
> Notice the slice operator.  This converts the static array into a dynamic
> one.  Kind of ugly, but.

Also:

foo("blah".dup);

will work.



More information about the Digitalmars-d mailing list