D - rtti?
- Dario (12/12) Jul 03 2002 (This surely has been already told. I remember I have read about it
- Burton Radons (4/11) Jul 04 2002 This is correct and should work. Could you boil it down to the smallest...
- Dario (10/20) Jul 04 2002 This compiles good but emits a runtime error:
- Burton Radons (4/22) Jul 04 2002 All references are initialised to null, so you're dereferencing a null
- Dario (2/2) Jul 04 2002 ARGH! I'm so stupid that I forgot that! Thank you Burton! =]
(This surely has been already told. I remember I have read about it somewhere, but I don't remember where... I apologize.) What's the D sintax for RTTI? I tried if(instance.typeinfo === Class.typeinfo) {/*...*/} but this doesn't work. I tried if(instance.classinfo === Class.classinfo) {/*...*/} but this generates an internal error. How should I write the D equivalent of the following C++ code? #include <typeinfo> class Class {} instance; if(typeid(instance) == typeid(Class)) {/*...*/} Thanks in advance for helping me! Dario
Jul 03 2002
Dario wrote:(This surely has been already told. I remember I have read about it somewhere, but I don't remember where... I apologize.)We discussed it a few weeks ago, but your problem is new.What's the D sintax for RTTI? I tried if(instance.typeinfo === Class.typeinfo) {/*...*/} but this doesn't work. I tried if(instance.classinfo === Class.classinfo) {/*...*/} but this generates an internal error.This is correct and should work. Could you boil it down to the smallest amount of code that can cause the internal error and then post that?
Jul 04 2002
(This surely has been already told. I remember I have read about it somewhere, but I don't remember where... I apologize.)We discussed it a few weeks ago, but your problem is new.What's the D sintax for RTTI? I tried if(instance.typeinfo === Class.typeinfo) {/*...*/} but this doesn't work. I tried if(instance.classinfo === Class.classinfo) {/*...*/} but this generates an internal error.This is correct and should work. Could you boil it down to the smallest amount of code that can cause the internal error and then post that?This compiles good but emits a runtime error: Error: Object 00690D70 begin 666 test.d ""GT` ` end
Jul 04 2002
Dario wrote:All references are initialised to null, so you're dereferencing a null pointer there. Putting a "a = new AAA;" before that line should make it work, although you may need to add a constructor.(This surely has been already told. I remember I have read about it somewhere, but I don't remember where... I apologize.)We discussed it a few weeks ago, but your problem is new.What's the D sintax for RTTI? I tried if(instance.typeinfo === Class.typeinfo) {/*...*/} but this doesn't work. I tried if(instance.classinfo === Class.classinfo) {/*...*/} but this generates an internal error.This is correct and should work. Could you boil it down to the smallest amount of code that can cause the internal error and then post that?This compiles good but emits a runtime error: Error: Object 00690D70
Jul 04 2002
ARGH! I'm so stupid that I forgot that! Thank you Burton! =] Dario
Jul 04 2002