Thread overview
Interface member types are perceived as properties
Jul 15, 2004
Matthew Wilson
Jul 17, 2004
Walter
Jul 17, 2004
Matthew
Jul 17, 2004
Matthew
July 15, 2004
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
"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
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
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.
> >
> >
>
>