Thread overview | ||||||
---|---|---|---|---|---|---|
|
July 15, 2004 Interface member types are perceived as properties | ||||
---|---|---|---|---|
| ||||
e.g. interface IContainer { . . . Class Container : public IContainer { . . . } alias Container selected_type; // static selecting_type hack; } . . . template BaseSelector(T) { // alias typeof(T.hack) selected_type; alias T.selected_type selected_type; } I have to use the commented "hack" lines. |
July 17, 2004 Re: Interface member types are perceived as properties | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew Wilson | "Matthew Wilson" <dmd@synesis.com.au> wrote in message news:cd4ugj$1hpi$1@digitaldaemon.com... > > e.g. > > interface IContainer > { > . . . > > Class Container > : public IContainer > { > . . . > } > > alias Container selected_type; > > // static selecting_type hack; > > } > > > . . . > > template BaseSelector(T) > { > // alias typeof(T.hack) selected_type; > alias T.selected_type selected_type; > } > > > I have to use the commented "hack" lines. I really need a compilable example. Exactly how are you instantiating BaseSelector? The reason I always ask for complete examples is I cannot count the number of times I've mocked up an example based on the complaint's description, only to find that it works fine. There was something else causing the problem that wasn't mentioned in the description that the person assumed was irrelevant. |
July 17, 2004 Re: Interface member types are perceived as properties | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Sure. Let me try and come up with one. "Walter" <newshound@digitalmars.com> wrote in message news:cda8hs$ssu$1@digitaldaemon.com... > > "Matthew Wilson" <dmd@synesis.com.au> wrote in message news:cd4ugj$1hpi$1@digitaldaemon.com... > > > > e.g. > > > > interface IContainer > > { > > . . . > > > > Class Container > > : public IContainer > > { > > . . . > > } > > > > alias Container selected_type; > > > > // static selecting_type hack; > > > > } > > > > > > . . . > > > > template BaseSelector(T) > > { > > // alias typeof(T.hack) selected_type; > > alias T.selected_type selected_type; > > } > > > > > > I have to use the commented "hack" lines. > > I really need a compilable example. Exactly how are you instantiating BaseSelector? The reason I always ask for complete examples is I cannot count the number of times I've mocked up an example based on the complaint's description, only to find that it works fine. There was something else causing the problem that wasn't mentioned in the description that the person assumed was irrelevant. > > |
July 17, 2004 Re: Interface member types are perceived as properties | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew | I'm working too fast. I already submitted one of these, under the "Aliases not passed down to child classes" thread. "Matthew" <admin@stlsoft.dot.dot.dot.dot.org> wrote in message news:cdad52$uvj$1@digitaldaemon.com... > Sure. Let me try and come up with one. > > > "Walter" <newshound@digitalmars.com> wrote in message news:cda8hs$ssu$1@digitaldaemon.com... > > > > "Matthew Wilson" <dmd@synesis.com.au> wrote in message news:cd4ugj$1hpi$1@digitaldaemon.com... > > > > > > e.g. > > > > > > interface IContainer > > > { > > > . . . > > > > > > Class Container > > > : public IContainer > > > { > > > . . . > > > } > > > > > > alias Container selected_type; > > > > > > // static selecting_type hack; > > > > > > } > > > > > > > > > . . . > > > > > > template BaseSelector(T) > > > { > > > // alias typeof(T.hack) selected_type; > > > alias T.selected_type selected_type; > > > } > > > > > > > > > I have to use the commented "hack" lines. > > > > I really need a compilable example. Exactly how are you instantiating BaseSelector? The reason I always ask for complete examples is I cannot count the number of times I've mocked up an example based on the complaint's description, only to find that it works fine. There was something else causing the problem that wasn't mentioned in the description that the person assumed was irrelevant. > > > > > > |
Copyright © 1999-2021 by the D Language Foundation