Why version() ?

Daniel Keep daniel.keep.lists at gmail.com
Tue Feb 10 06:44:29 PST 2009



Denis Koroskin wrote:
> [snip]
> 
> Other use-case I came across recently reading .NET Framework source code:
> 
> class String :
>    IFoo,
>    IBar,
>    IBaz,
> #if SUPPORT_GENERICS
>    IComparable<Foo>,
> #endif
>    IWhee
> {
>    // *very* large amount of code
> }
> 
> How would you port it to D without code duplication and meaningless
> intermediate classes?

I think I once tried something where I was building a list of interface
types as a tuple, then tried this:

class Foo : InterfaceTuple { ... }

Didn't work, though.

  -- Daniel



More information about the Digitalmars-d mailing list