fork(1) download
  1. import std.traits;
  2. import std.range;
  3.  
  4. struct Test
  5. {
  6. bool empty() { return true; }
  7. int popFront() { return 10; }
  8. int front(int) { return 10; }
  9. }
  10.  
  11. auto test(Range)(Range r) if (isInputRange!(Range))
  12. {}
  13.  
  14. void main() {
  15. Test t;
  16. test(t);
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.d(16): Error: template prog.test(Range) if (isInputRange!(Range)) does not match any function template declaration
prog.d(16): Error: template prog.test(Range) if (isInputRange!(Range)) cannot deduce template function from argument types !()(Test)
stdout
Standard output is empty