From ab76a306b7b2289e6f83665ba495ac0b048ab779 Mon Sep 17 00:00:00 2001 From: Mike Bosse Date: Tue, 28 Oct 2014 08:54:41 +0100 Subject: [PATCH] using dynamic_cast to check base class typeid --- gtsam/nonlinear/Values.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */