static map as a type function

Stefan Koch uplink.coder at googlemail.com
Thu Sep 24 15:59:51 UTC 2020


On Thursday, 24 September 2020 at 15:57:03 UTC, Stefan Koch wrote:
> On Thursday, 24 September 2020 at 15:54:55 UTC, Adam D. Ruppe 
> wrote:
>> On Thursday, 24 September 2020 at 14:36:45 UTC, Stefan Koch 
>> wrote:
>>> Let me show you the code that does only typeid.name
>>
>> What if TypeInfo was templated instead of magically generated? 
>> So the compiler doesn't need to do all this stuff.
>
> You still have to instantiate all those templates and do it 
> correctly.
> Which means the compiler needs some way of exposing all the 
> information via the templates system.
>
> Which essentially requires the same code.

Oh and typeinfo has to be generated eagerly!
Whereas the current way it works with ctfe is lazy.
Which means as long as nothing else requires typeinfo, using it 
at CTFE does not require you to generate it.
So code that only uses type info at ctfe does compile with 
-betterC.


More information about the Digitalmars-d mailing list