interface I1 { ... }
interface I2 { ... }
struct List(T) { ... }
How do I specialize my List to operate only on classes that implement both I1 and I2? One interface is easy:
struct List(T : I1)
Other languages. In C# it's:
struct List<T> where T : I1, I2
And in Java I'd say:
class List<T extends I1 & I2>
One catch: I don't want an if template constraint because I want reasonable auto-completion from a non-state-of-the-art IDEs. I think it'll be long before IDEs for D do things like reverse-engineering template constraints to deduce a list possible T's methods. And even if, that doesn't sound like cheap performance-wise.