phobos currently checks "static interfaces" with something like https://github.com/D-Programming-Language/phobos/blob/master/std/range.d#L213

I wonder if stuff like that could be unified by only defining normal interfaces and "automating" the static checking with something like

template implements(T, I) if (is(I == interface))
{
enum implements = is(typeof({foreach(t;__traits(allMembers,I)) // check T}));
}

Possible? Reasonable?

Reply via email to