February 14, 2004 Re: Constrained Templates | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | But it still doesn't solve the problem of interface conformance. What if subclasses of Bar hide interfaces that the template needs ? "Walter" <walter@digitalmars.com> wrote in message news:c0khog$1tu8$1@digitaldaemon.com... > > "Eric Decker" <Eric_member@pathlink.com> wrote in message news:c0h3hm$2h5h$1@digitaldaemon.com... > > I was wondering if there is any intention of providing constrained > templates. > > Already there: > > template foo(T : Bar) { ... } > > means that T can only be a Bar or a type derived from Bar. > > |
February 15, 2004 Re: Constrained Templates | ||||
---|---|---|---|---|
| ||||
Posted in reply to Achilleas Margaritis | It probably won't compile the template instantiation successfully. "Achilleas Margaritis" <axilmar@b-online.gr> wrote in message news:c0ksmv$2i4s$1@digitaldaemon.com... > But it still doesn't solve the problem of interface conformance. What if subclasses of Bar hide interfaces that the template needs ? > > "Walter" <walter@digitalmars.com> wrote in message news:c0khog$1tu8$1@digitaldaemon.com... > > > > "Eric Decker" <Eric_member@pathlink.com> wrote in message news:c0h3hm$2h5h$1@digitaldaemon.com... > > > I was wondering if there is any intention of providing constrained > > templates. > > > > Already there: > > > > template foo(T : Bar) { ... } > > > > means that T can only be a Bar or a type derived from Bar. > > > > > > |
Copyright © 1999-2021 by the D Language Foundation