DIP proposal: Enum parameters

Quirin Schroll qs.il.paperinik at gmail.com
Wed Sep 28 14:19:50 UTC 2022


On Tuesday, 27 September 2022 at 21:02:39 UTC, TheGag96 wrote:
> Hmm okay. The idea of detecting compile-time-ness is really 
> great I think, but I have always figured it's an issue that 
> there's no way currently to have a compile-time parameter and 
> do all the nice checking that can come with that without 
> introducing some level of template bloat.

The template bloat is unavoidable to some degree. If you want to 
do Design by Introspection, it’s hard to imagine how to do 
without.

However, CTFE alone does not instantiate templates. Types do not 
exist at run-time, but they do exist at half of the compile-time. 
By that I mean that there’s two compile-times, CTFE and the rest 
(including e.g. template instantiation), and at the latter, types 
do exist, but at CTFE, they don’t. Stefan Koch tried to change 
that when implementing type functions ([one thread about 
it](https://forum.dlang.org/thread/jyweryaicaumoaozyfdc@forum.dlang.org)). With those, symbols (including types) would exist and could be inspected and manipulated with CTFE.


More information about the Digitalmars-d mailing list