true type, and is_same

release/4.3a0
kartik arcot 2023-01-23 10:18:24 -08:00 committed by Frank Dellaert
parent 8ecb7d5367
commit 111d911377
2 changed files with 6 additions and 4 deletions

View File

@ -338,8 +338,8 @@ namespace gtsam {
// supplied \c filter function.
template<class ValueType>
static bool filterHelper(const std::function<bool(Key)> filter, const ConstKeyValuePair& key_value) {
// static_assert if ValueType is not Value
static_assert(std::is_same<Value, ValueType>::value, "ValueType must be type: Value");
// static_assert if ValueType is type: Value
static_assert(!std::is_same<Value, ValueType>::value, "ValueType must not be type: Value to use this filter");
// Filter and check the type
return filter(key_value.key) && (dynamic_cast<const GenericValue<ValueType>*>(&key_value.value));
}

View File

@ -19,6 +19,8 @@
#include <gtsam_unstable/nonlinear/expressionTesting.h>
#include <CppUnitLite/TestHarness.h>
#include <type_traits>
using namespace gtsam;
@ -46,8 +48,8 @@ struct ProjectionChart {
namespace gtsam {
namespace traits {
template<> struct is_chart<ProjectionChart> : public boost::true_type {};
template<> struct dimension<ProjectionChart> : public boost::integral_constant<int, 2> {};
template<> struct is_chart<ProjectionChart> : public std::true_type {};
template<> struct dimension<ProjectionChart> : public std::integral_constant<int, 2> {};
} // namespace traits
} // namespace gtsam