Untitled

mail@pastecode.io avatar
unknown
plain_text
13 days ago
271 B
0
Indexable
Never
#include <iostream>

using namespace std;

template<typename T>

int Plus (const int a, T fp)

{

return fp(a);

}

int main ()

{

auto plus_one = [value=1] (const int x) -> int

{

return x + value;

};

int res = Plus (5, plus_one);

cout << res << endl;

return 0;

}
Leave a Comment