Untitled

 avatar
unknown
plain_text
10 months ago
271 B
2
Indexable
#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;

}
Editor is loading...
Leave a Comment