From 69428c50fb7ccb4526bec5b86c9bdc3c435ec2bd Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Mon, 2 Jan 2012 20:13:01 +0000 Subject: [PATCH] Removed 'typeof' that is not supported by matlab compiler --- gtsam/inference/FactorGraph-inl.h | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/gtsam/inference/FactorGraph-inl.h b/gtsam/inference/FactorGraph-inl.h index 72c07f82a..9772cc790 100644 --- a/gtsam/inference/FactorGraph-inl.h +++ b/gtsam/inference/FactorGraph-inl.h @@ -29,8 +29,7 @@ #include #include #include -#include -#include +#include #include #include @@ -108,16 +107,10 @@ namespace gtsam { template typename DERIVED::shared_ptr Combine(const FactorGraph& factors, const FastMap >& variableSlots) { - typedef const FastMap > VariableSlots; - typedef typeof(boost::lambda::bind(&VariableSlots::value_type::first, boost::lambda::_1)) - FirstGetter; - typedef boost::transform_iterator IndexIterator; - FirstGetter firstGetter(boost::lambda::bind( - &VariableSlots::value_type::first, boost::lambda::_1)); - IndexIterator keysBegin(variableSlots.begin(), firstGetter); - IndexIterator keysEnd(variableSlots.end(), firstGetter); - return typename DERIVED::shared_ptr(new DERIVED(keysBegin, keysEnd)); + typedef const pair > KeySlotPair; + return typename DERIVED::shared_ptr(new DERIVED( + boost::make_transform_iterator(variableSlots.begin(), boost::bind(&KeySlotPair::first, _1)), + boost::make_transform_iterator(variableSlots.end(), boost::bind(&KeySlotPair::first, _1)))); } /* ************************************************************************* */