Re: constant expression

2016-02-24 Thread Marc Schütz via Digitalmars-d-learn
On Tuesday, 23 February 2016 at 08:00:24 UTC, Nicholas Wilson wrote: Silly question. Why is this necessary? Due to a problem with the implementation, associative arrays currently can't be initialized statically. We hope it will eventually get fixed, but until then, you have to use module con

Re: constant expression

2016-02-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/23/16 3:00 AM, Nicholas Wilson wrote: On Tuesday, 23 February 2016 at 07:43:37 UTC, Ali Çehreli wrote: On 02/22/2016 11:38 PM, Nicholas Wilson wrote: I've tried with both mutable and immutable a module scope. Scope I want is global (don't care about mutability) Uncomment immutable if y

Re: constant expression

2016-02-23 Thread Nicholas Wilson via Digitalmars-d-learn
On Tuesday, 23 February 2016 at 07:43:37 UTC, Ali Çehreli wrote: On 02/22/2016 11:38 PM, Nicholas Wilson wrote: I've tried with both mutable and immutable a module scope. Scope I want is global (don't care about mutability) Uncomment immutable if you want immutable and remove 'shared' if y

Re: constant expression

2016-02-22 Thread Ali Çehreli via Digitalmars-d-learn
On 02/22/2016 11:38 PM, Nicholas Wilson wrote: I've tried with both mutable and immutable a module scope. Scope I want is global (don't care about mutability) Uncomment immutable if you want immutable and remove 'shared' if you want multiple of this per thread (probably not). /* immutable

Re: constant expression

2016-02-22 Thread Nicholas Wilson via Digitalmars-d-learn
On Tuesday, 23 February 2016 at 07:26:01 UTC, Ali Çehreli wrote: On 02/22/2016 09:52 PM, Nicholas Wilson wrote: How is this not a constant expression ? auto ctodtypes = [ "void" : "void", "uint32_t" : "uint", "uint64_t" : "ulong", "int32_t" : "int", "int64_t"

Re: constant expression

2016-02-22 Thread Ali Çehreli via Digitalmars-d-learn
On 02/22/2016 09:52 PM, Nicholas Wilson wrote: How is this not a constant expression ? auto ctodtypes = [ "void" : "void", "uint32_t" : "uint", "uint64_t" : "ulong", "int32_t" : "int", "int64_t" : "long", "char" : "char", "uint8_t" : "ubyte",