From 46581aee7ae91f9e1a3a4ede1257989a725be2c5 Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Fri, 6 Nov 2020 01:49:27 +0100 Subject: [PATCH] Exercises: Add lambda sorcery tasks --- exercises/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/exercises/README.md b/exercises/README.md index af02941..fe2a465 100644 --- a/exercises/README.md +++ b/exercises/README.md @@ -138,3 +138,17 @@ Compare the performance of: - `std::list` - `std::set` - `std::unordered_set` + +## Task 10 + +Have a look at [this](https://bollu.github.io/mathemagic/declarative/index.html). +Now, do that in C++! + +Utilize lambdas, `std::function`, and/or structs with call operators. +Critically think about ownership and minimize the amount of heap allocations. + +## Task 11 + +Take a look at [Boost's chat server example](https://www.boost.org/doc/libs/1_74_0/doc/html/boost_asio/examples/cpp11_examples.html#boost_asio.examples.cpp11_examples.chat). +Try to understand how the session's lifetime is managed by the server. +Focus on `std::enable_shared_from_this` in combination with lambda captures.