diff --git a/gtsam/nonlinear/Values.h b/gtsam/nonlinear/Values.h index 57dec755b..459277dd7 100644 --- a/gtsam/nonlinear/Values.h +++ b/gtsam/nonlinear/Values.h @@ -395,7 +395,7 @@ namespace gtsam { static bool filterHelper(const boost::function filter, const ConstKeyValuePair& key_value) { BOOST_STATIC_ASSERT((!std::is_same::value)); // Filter and check the type - return filter(key_value.key) && (typeid(GenericValue) == typeid(key_value.value) ); + return filter(key_value.key) && (dynamic_cast*>(&key_value.value)); } /** Serialization function */