From 2d36f27c159720eb464901fb22a70a654ac62415 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Tue, 23 Apr 2024 10:46:07 +0200 Subject: [PATCH] Try to not advertise optional misuse --- doc/PIDHandler.md | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/doc/PIDHandler.md b/doc/PIDHandler.md index b2a6ae506..76474ab0c 100644 --- a/doc/PIDHandler.md +++ b/doc/PIDHandler.md @@ -104,15 +104,8 @@ that most of the times you will see lines like this const auto value = pidHandler.getAlgoType("someAlgo").value(); ``` -This will throw an exception if some information is not available. If you want / -need to check first whether information is present you can do - -```cpp -const auto maybeValue = pidHandler.getAlgoType("someAlgo"); -if (maybeValue.has_value()) { - const auto value = maybeValue.value(); -} -``` +This will throw an exception if some information is not available. Check if the +optional has a value when actually using these utilities. ### Creating a PIDHandler for a complete event