Fix: bt2::CommonOptionField::hasField(): use has_value()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 10 Aug 2022 15:16:05 +0000 (11:16 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 11 Sep 2023 15:24:02 +0000 (11:24 -0400)
Can't convert `nonstd::optional<ConstField>` to `bool` for some reason
in this context.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I539700da37eb0c27944e2f2842b09df8c2b1b023
Reviewed-on: https://review.lttng.org/c/babeltrace/+/10835
Tested-by: jenkins <jenkins@lttng.org>
src/cpp-common/bt2/field.hpp

index 4b3853826b2871478eb9f634d9cc39dfd73d8b76..dd17945fa6c1e6a9f74f3265d03cb81e84f7d4d0 100644 (file)
@@ -1418,7 +1418,7 @@ public:
 
     bool hasField() const noexcept
     {
-        return this->field();
+        return this->field().has_value();
     }
 
     nonstd::optional<ConstField> field() const noexcept
This page took 0.057784 seconds and 4 git commands to generate.