release/4.3a0
kartik arcot 2023-01-23 10:04:39 -08:00 committed by Frank Dellaert
parent 2828879d02
commit 8ecb7d5367
1 changed files with 2 additions and 1 deletions

View File

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