Official DMD compiler written in D

Era Scarecrow rtcvb32 at yahoo.com
Thu Jan 10 12:48:08 PST 2013


On Thursday, 10 January 2013 at 19:57:29 UTC, Dmitry Olshansky 
wrote:
> Why not try to make an AA literal a universal entity for all 
> kinds of user-defined associative arrays? Then the actual 
> construction of AA is done via constructor taking some type 
> like AALiteral!(Key, Value) which is a sequence of Key, Value 
> pairs. It could be even presorted.

  Only problem I would see with that, is trying to give something 
to a non-template function.

auto x = AALiteral!(string, string)([]);

void func(string[string] something);

func(x); // x is not type string[string], is type 
xxx!string,string

  Course that brings up problem(s) with my own idea thrown out 
there.

  Seems like the problem is just determining storage type, at CTFE 
it calls one type of constructor while the non-CTFE calls 
another; So long as the structure is the same then passing it 
around wouldn't matter.


More information about the Digitalmars-d mailing list