How do I use CTFE to generate an immutable associative array at compile time?

Stefan Koch via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 22 08:08:45 PST 2017


On Wednesday, 22 February 2017 at 15:27:22 UTC, H. S. Teoh wrote:
  (In fact, now I'm wondering if we could just
> hack dmd to emit the equivalent of this code as a lowering, 
> whenever the user tries to declare a compile-time initialized 
> AA.)

All the problems disappear if the AA's are compiler visible and 
CTFEable code.

There is as far as I know a project by Martin Nowak that does 
that.
And uses templates for AA's rather then whacky TypeInfos.

So in the future this problem will disappear.



More information about the Digitalmars-d-learn mailing list