Thread overview | ||||||
---|---|---|---|---|---|---|
|
May 23, 2004 RTTI for templates | ||||
---|---|---|---|---|
| ||||
Hallo, Is there a special RTTI for templates? What are the RTTI rules for templates? IMHO classinfo.name should reflect the type used when instancing the template. There is not much information about RTTI given in docs ;-( Stephan |
May 23, 2004 Re: RTTI for templates | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stephan Wienczny | ??? Templates are no types! Could you clarify what you mean?
Currently I do not see where templates and RTTI should interfere with each other. Templates are handled at compile-time. I do not see where runtime-polymorphism, and with it, RTTI should come into play there.
Stephan Wienczny wrote:
> Hallo,
>
> Is there a special RTTI for templates? What are the RTTI rules for
> templates?
> IMHO classinfo.name should reflect the type used when instancing the
> template.
>
> There is not much information about RTTI given in docs ;-(
>
> Stephan
|
May 23, 2004 Re: RTTI for templates | ||||
---|---|---|---|---|
| ||||
Posted in reply to Norbert Nemec | Norbert Nemec wrote: >??? Templates are no types! Could you clarify what you mean? > >Currently I do not see where templates and RTTI should interfere with each >other. Templates are handled at compile-time. I do not see where >runtime-polymorphism, and with it, RTTI should come into play there. > > I think he may mean something like: class Thing(T) { } void main() { Thing!(int) thing = new Thing!(int); printf("%.*s\n", thing.classinfo.name); } output: Thing Parhaps the output should really be: Thing!(int) > >Stephan Wienczny wrote: > > > >>Hallo, >> >>Is there a special RTTI for templates? What are the RTTI rules for >>templates? >>IMHO classinfo.name should reflect the type used when instancing the >>template. >> >>There is not much information about RTTI given in docs ;-( >> >>Stephan >> >> > > > -- -Anderson: http://badmama.com.au/~anderson/ |
May 23, 2004 Re: RTTI for templates | ||||
---|---|---|---|---|
| ||||
Posted in reply to J Anderson | J Anderson wrote:
> I think he may mean something like:
>
>
> class Thing(T)
> {
>
> }
>
> void main()
> {
> Thing!(int) thing = new Thing!(int);
>
> printf("%.*s\n", thing.classinfo.name);
>
> }
>
> output:
> Thing
>
> Perhaps the output should really be:
> Thing!(int)
Of course it should. I would consider that just a plain bug in the implementation.
|
Copyright © 1999-2021 by the D Language Foundation