using dynamic_cast to check base class typeid
parent
bc094951ed
commit
ab76a306b7
|
|
@ -395,7 +395,7 @@ namespace gtsam {
|
||||||
static bool filterHelper(const boost::function<bool(Key)> filter, const ConstKeyValuePair& key_value) {
|
static bool filterHelper(const boost::function<bool(Key)> filter, const ConstKeyValuePair& key_value) {
|
||||||
BOOST_STATIC_ASSERT((!std::is_same<ValueType,Value>::value));
|
BOOST_STATIC_ASSERT((!std::is_same<ValueType,Value>::value));
|
||||||
// Filter and check the type
|
// Filter and check the type
|
||||||
return filter(key_value.key) && (typeid(GenericValue<ValueType>) == typeid(key_value.value) );
|
return filter(key_value.key) && (dynamic_cast<const GenericValue<ValueType>*>(&key_value.value));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Serialization function */
|
/** Serialization function */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue