@@ -100,7 +100,7 @@ namespace pcl
100100 plus (std::remove_const_t <T> &l, const T &r)
101101 {
102102 using type = std::remove_all_extents_t <T>;
103- static const std::uint32_t count = sizeof (T) / sizeof (type);
103+ constexpr std::uint32_t count = sizeof (T) / sizeof (type);
104104 for (std::uint32_t i = 0 ; i < count; ++i)
105105 l[i] += r[i];
106106 }
@@ -117,7 +117,7 @@ namespace pcl
117117 plusscalar (T1 &p, const T2 &scalar)
118118 {
119119 using type = std::remove_all_extents_t <T1>;
120- static const std::uint32_t count = sizeof (T1) / sizeof (type);
120+ constexpr std::uint32_t count = sizeof (T1) / sizeof (type);
121121 for (std::uint32_t i = 0 ; i < count; ++i)
122122 p[i] += scalar;
123123 }
@@ -134,7 +134,7 @@ namespace pcl
134134 minus (std::remove_const_t <T> &l, const T &r)
135135 {
136136 using type = std::remove_all_extents_t <T>;
137- static const std::uint32_t count = sizeof (T) / sizeof (type);
137+ constexpr std::uint32_t count = sizeof (T) / sizeof (type);
138138 for (std::uint32_t i = 0 ; i < count; ++i)
139139 l[i] -= r[i];
140140 }
@@ -151,7 +151,7 @@ namespace pcl
151151 minusscalar (T1 &p, const T2 &scalar)
152152 {
153153 using type = std::remove_all_extents_t <T1>;
154- static const std::uint32_t count = sizeof (T1) / sizeof (type);
154+ constexpr std::uint32_t count = sizeof (T1) / sizeof (type);
155155 for (std::uint32_t i = 0 ; i < count; ++i)
156156 p[i] -= scalar;
157157 }
@@ -168,7 +168,7 @@ namespace pcl
168168 mulscalar (T1 &p, const T2 &scalar)
169169 {
170170 using type = std::remove_all_extents_t <T1>;
171- static const std::uint32_t count = sizeof (T1) / sizeof (type);
171+ constexpr std::uint32_t count = sizeof (T1) / sizeof (type);
172172 for (std::uint32_t i = 0 ; i < count; ++i)
173173 p[i] *= scalar;
174174 }
@@ -185,7 +185,7 @@ namespace pcl
185185 divscalar (T1 &p, const T2 &scalar)
186186 {
187187 using type = std::remove_all_extents_t <T1>;
188- static const std::uint32_t count = sizeof (T1) / sizeof (type);
188+ constexpr std::uint32_t count = sizeof (T1) / sizeof (type);
189189 for (std::uint32_t i = 0 ; i < count; ++i)
190190 p[i] /= scalar;
191191 }
@@ -202,7 +202,7 @@ namespace pcl
202202 divscalar2 (ArrayT &p, const ScalarT &scalar)
203203 {
204204 using type = std::remove_all_extents_t <ArrayT>;
205- static const std::uint32_t count = sizeof (ArrayT) / sizeof (type);
205+ constexpr std::uint32_t count = sizeof (ArrayT) / sizeof (type);
206206 for (std::uint32_t i = 0 ; i < count; ++i)
207207 p[i] = scalar / p[i];
208208 }
0 commit comments