Untitled

 avatar
unknown
plain_text
10 months ago
300 B
1
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);
    std::cout << res << std::endl;

    return 0;
}
Editor is loading...
Leave a Comment