dcollections 1.0 and 2.0a beta released
Walter Bright
newshound1 at digitalmars.com
Fri May 21 11:34:17 PDT 2010
Andrei Alexandrescu wrote:
> I wrote a solution to the problem in native D. It goes like this:
>
> alias Container!(int, addable | purgeable) Messerschmidt;
>
> void messWith(Messerschmidt i) {
> ... use i's capabilities to add and purge ...
> }
I agree with Michael Fortin that the | is questionable. I'd like to suggest
instead that it should instead be a variadic list of names, like:
alias Container!(int, addable, purgeable) Msserschmidt;
Perhaps the names should follow a naming convention,
alias Container!(int, ContainerAddable, ContainerPurgeable) Msserschmidt;
The problem with using scoped names, like Container.Addable, is scoped names
cannot be added to.
More information about the Digitalmars-d-announce
mailing list