Skip to content

Instantly share code, notes, and snippets.

@asa55
Created April 3, 2020 22:15
Show Gist options
  • Save asa55/5a139d86b20917b92abc45b7d4084745 to your computer and use it in GitHub Desktop.
Save asa55/5a139d86b20917b92abc45b7d4084745 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <vector>
int main()
{
auto square = [](int num){return num*num;};
auto print = [](int s){std::cout << s << std::endl;};
std::vector<int> values = { 0, 1, 2, 3, 4, 5 };
for (int value : values)
print(square(value));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment