From 58cb81452a123a4dd974328f59fadba02a5ac425 Mon Sep 17 00:00:00 2001 From: Heiko Thiel Date: Wed, 27 Mar 2019 16:59:49 +0100 Subject: [PATCH] Use C++11 static_assert instead of BOOST_STATIC_ASSERT and EIGEN_ASSERT --- .../include/pcl/apps/in_hand_scanner/boost.h | 1 - .../include/pcl/apps/in_hand_scanner/mesh_processing.h | 3 +-- common/include/pcl/common/impl/eigen.hpp | 6 +++--- geometry/include/pcl/geometry/mesh_conversion.h | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/boost.h b/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/boost.h index 1480e5ae014..a0e4a2d065f 100644 --- a/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/boost.h +++ b/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/boost.h @@ -44,7 +44,6 @@ # pragma GCC system_header #endif -#include #include #include #include diff --git a/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/mesh_processing.h b/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/mesh_processing.h index 546da7523b0..2609388cec3 100644 --- a/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/mesh_processing.h +++ b/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/mesh_processing.h @@ -57,8 +57,7 @@ namespace pcl typedef pcl::ihs::Mesh Mesh; typedef Mesh::HalfEdgeIndices HalfEdgeIndices; - // Currently works only on the manifold mesh. - BOOST_STATIC_ASSERT (Mesh::IsManifold::value); + static_assert (Mesh::IsManifold::value, "MeshProcessing currently works only on the manifold mesh."); /** \brief Constructor. */ MeshProcessing (); diff --git a/common/include/pcl/common/impl/eigen.hpp b/common/include/pcl/common/impl/eigen.hpp index d9005cb7f60..76386547efd 100644 --- a/common/include/pcl/common/impl/eigen.hpp +++ b/common/include/pcl/common/impl/eigen.hpp @@ -746,9 +746,9 @@ pcl::umeyama (const Eigen::MatrixBase& src, const Eigen::MatrixBase::Real RealScalar; typedef typename Derived::Index Index; - EIGEN_STATIC_ASSERT (!Eigen::NumTraits::IsComplex, NUMERIC_TYPE_MUST_BE_REAL) - EIGEN_STATIC_ASSERT ((Eigen::internal::is_same::Scalar>::value), - YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) + static_assert (!Eigen::NumTraits::IsComplex, "Numeric type must be real."); + static_assert ((Eigen::internal::is_same::Scalar>::value), + "You mixed different numeric types. You need to use the cast method of matrixbase to cast numeric types explicitly."); enum { Dimension = PCL_EIGEN_SIZE_MIN_PREFER_DYNAMIC (Derived::RowsAtCompileTime, OtherDerived::RowsAtCompileTime) }; diff --git a/geometry/include/pcl/geometry/mesh_conversion.h b/geometry/include/pcl/geometry/mesh_conversion.h index e28e79eb985..81c29c067c4 100644 --- a/geometry/include/pcl/geometry/mesh_conversion.h +++ b/geometry/include/pcl/geometry/mesh_conversion.h @@ -91,7 +91,7 @@ namespace pcl typedef typename HalfEdgeMesh::VertexDataCloud VertexDataCloud; typedef typename HalfEdgeMesh::VertexIndices VertexIndices; - BOOST_STATIC_ASSERT (HalfEdgeMesh::HasVertexData::value); // Output mesh must have data associated with the vertices! + static_assert (HalfEdgeMesh::HasVertexData::value, "Output mesh must have data associated with the vertices!"); VertexDataCloud vertices; pcl::fromPCLPointCloud2 (face_vertex_mesh.cloud, vertices);