diff --git a/rmw_zenoh_cpp/src/detail/payload.hpp b/rmw_zenoh_cpp/src/detail/payload.hpp index 4a521c58..8ddcf7be 100644 --- a/rmw_zenoh_cpp/src/detail/payload.hpp +++ b/rmw_zenoh_cpp/src/detail/payload.hpp @@ -29,8 +29,8 @@ class Payload public: explicit Payload(const zenoh::Bytes & bytes) { - auto slices = bytes.slice_iter(); - auto slice = slices.next(); + zenoh::Bytes::SliceIterator slices = bytes.slice_iter(); + std::optional slice = slices.next(); if (!slice.has_value()) { bytes_ = nullptr; } else {