On 3/20/19 4:11 AM, boolangery wrote:
On Tuesday, 19 March 2019 at 23:41:58 UTC, Steven Schveighoffer wrote:
On 3/19/19 7:22 PM, Bastiaan Veelo wrote:
Beware that a CT AA stores its elements in a different order than a
RT AA, which you would notice in a foreach, for example.
Yes, this is the
On Wednesday, 20 March 2019 at 08:11:27 UTC, boolangery wrote:
Got it ! Thank you, so I need to write:
enum string[string] CtfeFoo = ["foo" : "bar"];
static immutable string[string] Foo;
static this()
{
Foo = CtfeFoo;
}
string ctfeableFunction()
{
if (__ctfe)
return CtfeFoo["fo
On Tuesday, 19 March 2019 at 23:41:58 UTC, Steven Schveighoffer
wrote:
On 3/19/19 7:22 PM, Bastiaan Veelo wrote:
Beware that a CT AA stores its elements in a different order
than a RT AA, which you would notice in a foreach, for example.
Yes, this is the issue -- the runtime AA depends on dru
On 3/19/19 7:22 PM, Bastiaan Veelo wrote:
Beware that a CT AA stores its elements in a different order than a RT
AA, which you would notice in a foreach, for example.
Yes, this is the issue -- the runtime AA depends on druntime, which is
not available to the compiler. The compiler has its own
On Tuesday, 19 March 2019 at 08:50:15 UTC, boolangery wrote:
Hi,
I want to use a constant associative array in a ctfe-able
function.
Example:
string ctfeableFunction()
{
return Foo["foo"];
}
Then I force ctfe with:
enum res = ctfeableFunction();
When I use an enum like:
enum Foo = ["
Hi,
I want to use a constant associative array in a ctfe-able
function.
Example:
string ctfeableFunction()
{
return Foo["foo"];
}
Then I force ctfe with:
enum res = ctfeableFunction();
When I use an enum like:
enum Foo = ["foo" : "bar"];
It works fine.
D-Scanner keep saying to me: T