Skip to content

Instantly share code, notes, and snippets.

@shrimo
Created January 22, 2019 19:31
Show Gist options
  • Save shrimo/d8467d3980bb6d730d2f7945d0b818c7 to your computer and use it in GitHub Desktop.
Save shrimo/d8467d3980bb6d730d2f7945d0b818c7 to your computer and use it in GitHub Desktop.
// c++ -fpic -std=c++11 function.cpp -o function
#include<vector>
#include<iostream>
using namespace std;
int main()
{
auto func = [](int m, int x, vector<int> j){for (auto &c : j) cout<<"Y: "<<(m*x)+c<<"\n";};
func(5, 3, {1,2,3,4,5});
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment