fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template<class A, class B>
  5. auto K = [](A x) {
  6. return [=](B y) {
  7. return x;
  8. };
  9. };
  10.  
  11.  
  12. int main() {
  13.  
  14. K<int,int>(5);
  15. return 0;
  16. }
Compilation error #stdin compilation error #stdout 0s 3452KB
stdin
Standard input is empty
compilation info
prog.cpp: In instantiation of 'auto K<int, int>':
prog.cpp:14:2:   required from here
prog.cpp:5:6: error: use of 'K<int, int>' before deduction of 'auto'
 auto K = [](A x) {
      ^
stdout
Standard output is empty