On Monday, 12 June 2017 at 17:35:59 UTC, David Gileadi wrote:
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 backIf 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.
Yeah, I had meant to mention the compiler magic involved. I suppose the magic is far less than anything else though, since the compiler already associates surrounding docs to code (right?).
