#include <iostream>using namespace std; template<class A, class B>auto K = [](A x) { return [=](B y) { return x; };}; int main() { K<int,int>(5); return 0;}
Standard input is empty
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) { ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!