diff --git a/rmw_zenoh_cpp/src/detail/zenoh_utils.cpp b/rmw_zenoh_cpp/src/detail/zenoh_utils.cpp index dfb6fca2..65177795 100644 --- a/rmw_zenoh_cpp/src/detail/zenoh_utils.cpp +++ b/rmw_zenoh_cpp/src/detail/zenoh_utils.cpp @@ -121,7 +121,7 @@ Payload::Payload(const zenoh::Bytes & bytes) } } -const uint8_t * Payload::data() +const uint8_t * Payload::data() const { if (std::holds_alternative(bytes_)) { return nullptr; @@ -132,7 +132,7 @@ const uint8_t * Payload::data() } } -size_t Payload::size() +size_t Payload::size() const { if (std::holds_alternative(bytes_)) { return 0; @@ -143,7 +143,7 @@ size_t Payload::size() } } -bool Payload::empty() +bool Payload::empty() const { return std::holds_alternative(bytes_); } diff --git a/rmw_zenoh_cpp/src/detail/zenoh_utils.hpp b/rmw_zenoh_cpp/src/detail/zenoh_utils.hpp index f4305491..c4b8d69f 100644 --- a/rmw_zenoh_cpp/src/detail/zenoh_utils.hpp +++ b/rmw_zenoh_cpp/src/detail/zenoh_utils.hpp @@ -108,7 +108,7 @@ class Payload // Is `std::vector` in case of a non-contiguous payload // and `zenoh::Slice` plus a `zenoh::Bytes` otherwise. std::variant bytes_; -} +}; } // namespace rmw_zenoh_cpp #endif // DETAIL__ZENOH_UTILS_HPP_