Thread overview | |||||
---|---|---|---|---|---|
|
February 09, 2003 default c'tor - syntax problem | ||||
---|---|---|---|---|
| ||||
The example below compiles fine with "A a();" in main replaced with "A a;". AFAIK there should be no problem with either syntax.. struct A { A() { } void fn() { } }; void main() { A a(); a.fn(); // Error: not a struct or union type // Warning 6: value of expression is not used } Low priority. Richard |
February 09, 2003 Re: default c'tor - syntax problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to Richard Grant | On Sun, 9 Feb 2003 16:13:39 +0000 (UTC), Richard Grant wrote: > void main() { > A a(); This declares "a" as a function returning A. > a.fn(); > // Error: not a struct or union type > // Warning 6: value of expression is not used > } AFAIK, DMC's behaviour is correct. bye, Christof -- http://cmeerw.org JID: cmeerw@jabber.at mailto cmeerw at web.de ...and what have you contributed to the Net? |
February 09, 2003 Re: default c'tor - syntax problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to Christof Meerwald | In article <b260id$2c3g$1@digitaldaemon.com>, Christof Meerwald says... > >On Sun, 9 Feb 2003 16:13:39 +0000 (UTC), Richard Grant wrote: >> void main() { >> A a(); > >This declares "a" as a function returning A. > >> a.fn(); >> // Error: not a struct or union type >> // Warning 6: value of expression is not used >> } > >AFAIK, DMC's behaviour is correct. And you are correct.. Thanks, Richard |
Copyright © 1999-2021 by the D Language Foundation