Thread overview | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
October 20, 2003 bug: assoc arrays by structs | ||||
---|---|---|---|---|
| ||||
The following doesn't link: struct A {} void main() { int [A] w; A a; w[a]=8; } Outputs: Error 42: Symbol Undefined __init_14TypeInfo_S1x1A. ------------------------- Carlos Santander --- Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.528 / Virus Database: 324 - Release Date: 2003-10-16 |
October 22, 2003 Re: assoc arrays by structs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos Santander B. | "Carlos Santander B." <carlos8294@msn.com> wrote in message news:bn182h$qup$1@digitaldaemon.com... > The following doesn't link: > > struct A {} > void main() { > int [A] w; > A a; > w[a]=8; > } > > Outputs: Error 42: Symbol Undefined __init_14TypeInfo_S1x1A. Yes. It needs a typeinfo class for it to work. Unfortunately, I haven't figured out a way for this to work for user defined types. To make it work for now, you'll need to write one, see the ti_*.d files in phobos for reference. They're pretty simple. |
October 22, 2003 Re: assoc arrays by structs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | "Walter" <walter@digitalmars.com> wrote in message news:bn5ee6$2cfd$1@digitaldaemon.com... | | Yes. It needs a typeinfo class for it to work. Unfortunately, I haven't | figured out a way for this to work for user defined types. To make it work | for now, you'll need to write one, see the ti_*.d files in phobos for | reference. They're pretty simple. | | But the same works if A is a class instead of a struct. ————————————————————————— Carlos Santander --- Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.528 / Virus Database: 324 - Release Date: 2003-10-16 |
October 22, 2003 Re: assoc arrays by structs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | What is the difference between a TypeInfo and a ClassInfo? Sean "Walter" <walter@digitalmars.com> wrote in message news:bn5ee6$2cfd$1@digitaldaemon.com... > > "Carlos Santander B." <carlos8294@msn.com> wrote in message news:bn182h$qup$1@digitaldaemon.com... > > The following doesn't link: > > > > struct A {} > > void main() { > > int [A] w; > > A a; > > w[a]=8; > > } > > > > Outputs: Error 42: Symbol Undefined __init_14TypeInfo_S1x1A. > > Yes. It needs a typeinfo class for it to work. Unfortunately, I haven't figured out a way for this to work for user defined types. To make it work for now, you'll need to write one, see the ti_*.d files in phobos for reference. They're pretty simple. |
January 29, 2004 Re: assoc arrays by structs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos Santander B. | "Carlos Santander B." <carlos8294@msn.com> wrote in message news:bn65s2$9re$1@digitaldaemon.com... > "Walter" <walter@digitalmars.com> wrote in message > news:bn5ee6$2cfd$1@digitaldaemon.com... > | > | Yes. It needs a typeinfo class for it to work. Unfortunately, I haven't > | figured out a way for this to work for user defined types. To make it work > | for now, you'll need to write one, see the ti_*.d files in phobos for > | reference. They're pretty simple. > | > | > > But the same works if A is a class instead of a struct. Right. That's because a class has the several predefined virtual functions needed. |
January 29, 2004 Re: assoc arrays by structs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean L. Palmer | "Sean L. Palmer" <palmer.sean@verizon.net> wrote in message news:bn6cdp$imr$1@digitaldaemon.com... > What is the difference between a TypeInfo and a ClassInfo? TypeInfo gives information on any type, ClassInfo just for classes. |
January 29, 2004 Re: assoc arrays by structs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | This seems like an implementation detail that has leaked out. Sean "Walter" <walter@digitalmars.com> wrote in message news:bva2mu$3198$2@digitaldaemon.com... > > "Sean L. Palmer" <palmer.sean@verizon.net> wrote in message news:bn6cdp$imr$1@digitaldaemon.com... > > What is the difference between a TypeInfo and a ClassInfo? > > TypeInfo gives information on any type, ClassInfo just for classes. |
Copyright © 1999-2021 by the D Language Foundation