On 6/11/17 1:32 PM, Sebastiaan Koppe wrote:

What about using ddoc?

enum bool isInputRange(R) =
     is(typeof((ref R r) => r)) /// must be copyable
&& is(ReturnType!((R r) => r.empty) == bool) /// must support bool empty
     && is(typeof(lvalueOf!R.front)) /// must support front
     && is(typeof(lvalueOf!R.popFront)) /// must support back

If there's going to be compiler magic, this seems like a sensible syntax--documenting constraints is a good idea anyway, particularly for those of us who aren't is-expression masters.

Reply via email to