Created
April 3, 2020 22:15
-
-
Save asa55/5a139d86b20917b92abc45b7d4084745 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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