How to get compatible symbol names and runtime typeid names for templated classes?
Arafel
er.krali at gmail.com
Tue May 3 14:38:53 UTC 2022
On 3/5/22 15:57, Adam D Ruppe wrote:
> So doing things yourself gives you some control.
Yes, it is indeed possible (I acknowledged it), but I think it's much
more cumbersome than it should, and puts the load on the user.
If templated this worked in static context (ideally everywhere else
too), then we'd be able to implement RTTI in a 100% "pay as you go" way:
just inherit from SerializableObject, or perhaps add a mixin to your own
root class, and that'd be it.
Actually, it would be cool to do it through an interface, although I
don't think an interface's static constructors are invoked by the
implementing classes... it would be cool, though.
And, in one of the bugs, you argue yourself that according to the spec,
it *should* work. So please let me just whine... I mean, raise awareness
;-), in case somebody thinks it's interesting and feels brave enough to
have a go at it.
I'd try it myself, but I wouldn't know where to start. Compiler
internals are way beyond my comfort zone...
More information about the Digitalmars-d-learn
mailing list