From a9dd644015aaa6550034c8ad27eeacb369c7e809 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Mon, 6 Feb 2023 00:08:57 -0800 Subject: [PATCH] use static_assert --- gtsam/base/Matrix.h | 2 +- gtsam/base/std_optional_serialization.h | 2 +- wrap/matlab.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gtsam/base/Matrix.h b/gtsam/base/Matrix.h index 60fed671a0..6dba9cb051 100644 --- a/gtsam/base/Matrix.h +++ b/gtsam/base/Matrix.h @@ -279,7 +279,7 @@ struct Reshape { template inline typename Reshape::ReshapedType reshape(const Eigen::Matrix & m){ - BOOST_STATIC_ASSERT(InM * InN == OutM * OutN); + static_assert(InM * InN == OutM * OutN); return Reshape::reshape(m); } diff --git a/gtsam/base/std_optional_serialization.h b/gtsam/base/std_optional_serialization.h index 07a02c2283..ec6eec56eb 100644 --- a/gtsam/base/std_optional_serialization.h +++ b/gtsam/base/std_optional_serialization.h @@ -67,7 +67,7 @@ void save(Archive& ar, const std::optional& t, const unsigned int /*version*/ // It is an inherent limitation to the serialization of optional.hpp // that the underlying type must be either a pointer or must have a // default constructor. - BOOST_STATIC_ASSERT(boost::serialization::detail::is_default_constructible::value || boost::is_pointer::value); + static_assert(boost::serialization::detail::is_default_constructible::value || boost::is_pointer::value); const bool tflag = t.has_value(); ar << boost::serialization::make_nvp("initialized", tflag); if (tflag) { diff --git a/wrap/matlab.h b/wrap/matlab.h index 645ba8edfa..5c38ac808a 100644 --- a/wrap/matlab.h +++ b/wrap/matlab.h @@ -490,7 +490,7 @@ Class* unwrap_ptr(const mxArray* obj, const string& propertyName) { //template <> //Vector unwrap_shared_ptr(const mxArray* obj, const string& propertyName) { // bool unwrap_shared_ptr_Vector_attempted = false; -// BOOST_STATIC_ASSERT(unwrap_shared_ptr_Vector_attempted, "Vector cannot be unwrapped as a shared pointer"); +// static_assert(unwrap_shared_ptr_Vector_attempted, "Vector cannot be unwrapped as a shared pointer"); // return Vector(); //} @@ -498,7 +498,7 @@ Class* unwrap_ptr(const mxArray* obj, const string& propertyName) { //template <> //Matrix unwrap_shared_ptr(const mxArray* obj, const string& propertyName) { // bool unwrap_shared_ptr_Matrix_attempted = false; -// BOOST_STATIC_ASSERT(unwrap_shared_ptr_Matrix_attempted, "Matrix cannot be unwrapped as a shared pointer"); +// static_assert(unwrap_shared_ptr_Matrix_attempted, "Matrix cannot be unwrapped as a shared pointer"); // return Matrix(); //}