1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
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<typename U> void operator() ()
{
- const char* name = traits::name<PointT, U>::value;
+ const char* name = pcl::traits::name<PointT, U>::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<PointT, U>::value;
+ std::uint32_t offset = pcl::traits::offset<PointT, U>::value;
stream_.next(offset);
- std::uint8_t datatype = traits::datatype<PointT, U>::value;
+ std::uint8_t datatype = pcl::traits::datatype<PointT, U>::value;
stream_.next(datatype);
- std::uint32_t count = traits::datatype<PointT, U>::size;
+ std::uint32_t count = pcl::traits::datatype<PointT, U>::size;
stream_.next(count);
}
@@ -49,7 +49,7 @@ namespace pcl
template<typename U> void operator() ()
{
- std::uint32_t name_length = strlen(traits::name<PointT, U>::value);
+ std::uint32_t name_length = strlen(pcl::traits::name<PointT, U>::value);
length += name_length + 13;
}
|