diff --git a/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/serdes.hpp b/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/serdes.hpp index a036141..add0a39 100644 --- a/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/serdes.hpp +++ b/rmw_cyclonedds_cpp/include/rmw_cyclonedds_cpp/serdes.hpp @@ -224,7 +224,9 @@ public: inline void deserialize (std::vector& x) { const uint32_t sz = deserialize32 (); x.resize (sz); - for (auto&& i : x) i = ((data + pos)[i] != 0); + for (size_t i = 0; i < sz; i++) { + x[i] = ((data + pos)[i] != 0); + } pos += sz; } template inline void deserialize (std::array& x) {