How to declare static compile-time assoc array inside struct?

Jonathan M Davis newsgroup.d at jmdavisprog.com
Tue Aug 14 02:47:18 UTC 2018


On Monday, August 13, 2018 6:14:56 AM MDT Andrey via Digitalmars-d-learn 
wrote:
> On Monday, 13 August 2018 at 11:53:06 UTC, rikki cattermole wrote:
> > Unsupported. AA's don't go between CT and RT. You must use a
> > module constructor to initialize it.
>
> Will be supported in future?

Maybe, but don't plan on it. Stefan Koch is working on a major rewrite for
CTFE (which he calls newCTFE), but it's going to be a while before that's
done (as in, it won't be done this year and has no definitive timeframe for
completion). I don't know if he has plans to improve AA support with newCTFE
(I think that he's mostly focused on getting to the point that it supports
everything that the current CTFE supports but way more efficiently), but
either way, I very much doubt that anyone is going to rework the current
CTFE implementation to support having AAs transfer from compile-time to
runtime. So, while you might get that ability at some point in the future,
for now (and possibly permanently), you will need to proceed without that
ability.

- Jonathan M Davis





More information about the Digitalmars-d-learn mailing list