using dynamic_cast to check base class typeid

release/4.3a0
Mike Bosse 2014-10-28 08:54:41 +01:00
parent bc094951ed
commit ab76a306b7
1 changed files with 1 additions and 1 deletions

View File

@ -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 */