Re: equivalent of typeid(Class).name at compile-time

2019-11-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/22/19 4:04 AM, Jacob Carlborg wrote: On Thursday, 21 November 2019 at 20:44:19 UTC, Steven Schveighoffer wrote: I thought I could do typeid(Class).name to get the class name that will be returned at runtime if you did typeid(instance).name. But it's not accessible at compile-time. What

Re: equivalent of typeid(Class).name at compile-time

2019-11-22 Thread Alexandru Ermicioi via Digitalmars-d-learn
On Thursday, 21 November 2019 at 20:48:03 UTC, Adam D. Ruppe wrote: On Thursday, 21 November 2019 at 20:45:16 UTC, Steven Schveighoffer wrote: To clarify, I need the compile time string that will match typeid(instance).name, so I can match the derived type. You have to make sure that the

Re: equivalent of typeid(Class).name at compile-time

2019-11-22 Thread Jacob Carlborg via Digitalmars-d-learn
On Thursday, 21 November 2019 at 20:44:19 UTC, Steven Schveighoffer wrote: I thought I could do typeid(Class).name to get the class name that will be returned at runtime if you did typeid(instance).name. But it's not accessible at compile-time. What compile-time string should I use for

Re: equivalent of typeid(Class).name at compile-time

2019-11-21 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 21 November 2019 at 20:45:16 UTC, Steven Schveighoffer wrote: To clarify, I need the compile time string that will match typeid(instance).name, so I can match the derived type. You have to make sure that the derived type is passed to your register function, but then

Re: equivalent of typeid(Class).name at compile-time

2019-11-21 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/21/19 3:44 PM, Steven Schveighoffer wrote: I thought I could do typeid(Class).name to get the class name that will be returned at runtime if you did typeid(instance).name. But it's not accessible at compile-time. What compile-time string should I use for instance in a constructed

equivalent of typeid(Class).name at compile-time

2019-11-21 Thread Steven Schveighoffer via Digitalmars-d-learn
I thought I could do typeid(Class).name to get the class name that will be returned at runtime if you did typeid(instance).name. But it's not accessible at compile-time. What compile-time string should I use for instance in a constructed switch statement? I'm trying to implement serialization