What type functions mean on a language level

sighoya sighoya at gmail.com
Sun Jan 3 14:05:21 UTC 2021


On Saturday, 2 January 2021 at 22:47:29 UTC, Stefan Koch wrote:
> You can use typeid at compiletime.
> I know because I implemented it.

```

void main()
{
     import std.algorithm, std.stdio, std.file, std.range;
     static assert(typeid(int)==typeid(float));
}

onlineapp.d(4): Error: static variable typeid(int) cannot be read 
at compile time
onlineapp.d(4):        called from here: opEquals(typeid(int), 
typeid(float))
onlineapp.d(4):        while evaluating: static 
assert(typeid(int) == typeid(float))

```

Or did you mean you have implemented it in your newCTFE branch?


More information about the Digitalmars-d mailing list