From 7f0e172a3e71e52589ea6738a7f5357f7784a677 Mon Sep 17 00:00:00 2001 From: Sebastien Ponce Date: Wed, 2 Oct 2024 09:50:28 +0200 Subject: [PATCH 1/2] Fixed missing line in std::optional example --- talk/morelanguage/morestl.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/talk/morelanguage/morestl.tex b/talk/morelanguage/morestl.tex index c5cf8ce7..4ead2b2b 100644 --- a/talk/morelanguage/morestl.tex +++ b/talk/morelanguage/morestl.tex @@ -102,6 +102,7 @@ return in; // equiv. to optional{in}; return {}; // or: return std::nullopt; (empty opt.) } + auto v = parse_phone(...); if (v) { // or: v.has_value() process_phone(v.value()); // or: *v (unchecked) v->call(); // calls Phone::call() (unchecked) From 25b519548cf245b24c830489f52a8986eb58db65 Mon Sep 17 00:00:00 2001 From: Sebastien Ponce Date: Wed, 2 Oct 2024 11:42:17 +0200 Subject: [PATCH 2/2] Drop call to request_stop on slide of jthread --- talk/concurrency/threadsasync.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talk/concurrency/threadsasync.tex b/talk/concurrency/threadsasync.tex index 8b0a3990..b33d6654 100644 --- a/talk/concurrency/threadsasync.tex +++ b/talk/concurrency/threadsasync.tex @@ -64,7 +64,7 @@ void bar() {...} int main() { std::jthread t1{foo}; - std::jthread t2{bar}; t2.request_stop(); + std::jthread t2{bar}; // No join required return 0; }