aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2021-11-22 05:59:48 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2021-11-22 05:59:48 +0000
commit8f0ee1694bfb20b1c07d92c2ef46f516cbfa6f29 (patch)
tree5505de6e91e2591b59044b27a44904bfd9fa1bd6
parentf4b08ddada8ff3865056138e900ebe966d870961 (diff)
downloadalgorithms-8f0ee1694bfb20b1c07d92c2ef46f516cbfa6f29.tar.gz
algorithms-8f0ee1694bfb20b1c07d92c2ef46f516cbfa6f29.tar.bz2
algorithms-8f0ee1694bfb20b1c07d92c2ef46f516cbfa6f29.zip
(list)+example for map in main
-rw-r--r--list.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/list.cpp b/list.cpp
index df8cc13..e95a0ac 100644
--- a/list.cpp
+++ b/list.cpp
@@ -80,6 +80,8 @@ int main(void)
std::cout << lst << std::endl;
lst = reverse(lst);
std::cout << lst << std::endl;
+ map<int, int>(lst = reverse(lst), [](int x){ return x * 2; });
+ std::cout << lst << std::endl;
delete lst;
return 0;
}