From bd21be2cb8ec6ad70a282c61b14aa9dd43edf9ff Mon Sep 17 00:00:00 2001 From: Markus Vieth <39675748+mvieth@users.noreply.github.com> Date: Mon, 21 Jun 2021 19:42:58 +0200 Subject: [PATCH] Use complete namespace for traits members (#330) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prevents errors like this: error: ‘name’ is not a member of ‘pcl::detail::traits’; did you mean ‘pcl::traits::name’? The error appears for newer PCL versions (everything after commit https://github.com/PointCloudLibrary/pcl/commit/d39d3d3300746b952997e5bd2742dac7482aa5ab), but this change should also be fully compatible with older PCL versions. --- pcl_ros/include/pcl_ros/point_cloud.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/pcl_ros/point_cloud.h b/pcl_ros/include/pcl_ros/point_cloud.h index 93df7365..3c57f298 100644 --- a/include/pcl_ros/point_cloud.h +++ b/include/pcl_ros/point_cloud.h @@ -23,19 +23,19 @@ namespace pcl template void operator() () { - const char* name = traits::name::value; + const char* name = pcl::traits::name::value; std::uint32_t name_length = strlen(name); stream_.next(name_length); if (name_length > 0) memcpy(stream_.advance(name_length), name, name_length); - std::uint32_t offset = traits::offset::value; + std::uint32_t offset = pcl::traits::offset::value; stream_.next(offset); - std::uint8_t datatype = traits::datatype::value; + std::uint8_t datatype = pcl::traits::datatype::value; stream_.next(datatype); - std::uint32_t count = traits::datatype::size; + std::uint32_t count = pcl::traits::datatype::size; stream_.next(count); } @@ -49,7 +49,7 @@ namespace pcl template void operator() () { - std::uint32_t name_length = strlen(traits::name::value); + std::uint32_t name_length = strlen(pcl::traits::name::value); length += name_length + 13; }