Initialization of the Associative arrays

Stewart Gordon smjg_1998 at yahoo.com
Mon Jul 14 18:03:18 PDT 2008


"BCS" <ao at pathlink.com> wrote in message 
news:55391cb32f3218cab3ecfa6cf778 at news.digitalmars.com...
<snip>
> I think much of this might come from the need to be able to eyeball parse 
> the code
>
> auto a = [ .... 16 different function calls ...];// what is the type of a?

But we're not dealing with an auto here.  We're dealing with an int[string]. 
With autotype declarations, it's necessary to treat initialisers as 
expressions.  When the type is specified, arrays can use static 
initialisers.

> I think as long as the type of an array literal isn't from the type of the 
> assigned the current solution is about as good as it will get.

No, as long as the compiler treats the original attempt as an array literal 
rather than as a static initialiser.

Stewart.

-- 
My e-mail address is valid but not my primary mailbox.  Please keep replies 
on the 'group where everybody may benefit. 



More information about the Digitalmars-d-learn mailing list