digitalmars.D - Classinfo of a base class.
- =?ISO-8859-1?Q?Julio_C=E9sar_Carrascal_Urquijo?= (16/16) Nov 03 2004 I would want to use the classinfo property of the base class in the
- Walter (3/19) Nov 03 2004 super.classinfo.name should work.
- Thomas Kuehne (11/12) Nov 03 2004 code:
- larrycowan (9/23) Nov 04 2004 # import std.stdio;
- Walter (3/17) Nov 04 2004 Ok, that's right. But try classinfo.base.name.
I would want to use the classinfo property of the base class in the static constructor of a template class, but the closest I could get was passing the class as an alias parameter: class Test(alias BaseClass) { static this() { writefln(BaseClass.classinfo.name); } } class TestBase : Test!(TestBase) { } Is there any other way to print the name of the base class in the static constructor? Thanks
Nov 03 2004
super.classinfo.name should work. "Julio César Carrascal Urquijo" <adnoctum phreaker.net> wrote in message news:cmbofh$10o6$1 digitaldaemon.com...I would want to use the classinfo property of the base class in the static constructor of a template class, but the closest I could get was passing the class as an alias parameter: class Test(alias BaseClass) { static this() { writefln(BaseClass.classinfo.name); } } class TestBase : Test!(TestBase) { } Is there any other way to print the name of the base class in the static constructor? Thanks
Nov 03 2004
Walter schrieb am Donnerstag, 4. November 2004 05:04:super.classinfo.name should work.code: test2 '_staticCtor' a.d(4): 'super' is only allowed in non-static member functions a.d(4): no property 'classinfo' for type 'int'
Nov 03 2004
In article <cmchq7$2khf$1 digitaldaemon.com>, Thomas Kuehne says...Walter schrieb am Donnerstag, 4. November 2004 05:04:void display_name() { Internal error: e2ir.c 814super.classinfo.name should work.code: test2 '_staticCtor' a.d(4): 'super' is only allowed in non-static member functions a.d(4): no property 'classinfo' for type 'int'
Nov 04 2004
"Thomas Kuehne" <thomas-dloop kuehne.cn> wrote in message news:cmchq7$2khf$1 digitaldaemon.com...Walter schrieb am Donnerstag, 4. November 2004 05:04:Ok, that's right. But try classinfo.base.name.super.classinfo.name should work.code: test2 '_staticCtor' a.d(4): 'super' is only allowed in non-static member functions a.d(4): no property 'classinfo' for type 'int'
Nov 04 2004