2010/11/28 Michel Fortin <michel.for...@michelf.com>:
> Well, if you consider the previously discussed 'adaptTo' function template,
> all types can be adapted to an interface (via a template-generated wrapper
> class). So "implements" for structs isn't too far off, as you can use the
> struct to implement the interface via 'adaptTo'.

Actually, adaptTo already uses such a template internally. So I would
suggest to just add this:

template conformsTo(T, Interfaces...)
{
 enum conformsTo = AdaptTo!Interfaces.hasRequiredMethods!T;
}

Reply via email to