From 715dc4474d282e0fc733521c8bf5eb7af1340c76 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Fri, 20 Nov 2009 14:18:26 +0000 Subject: [PATCH] functional STL magic --- cpp/FactorGraph-inl.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cpp/FactorGraph-inl.h b/cpp/FactorGraph-inl.h index eece27d80..7564e0347 100644 --- a/cpp/FactorGraph-inl.h +++ b/cpp/FactorGraph-inl.h @@ -13,6 +13,8 @@ #include #include #include +#include + #include #include #include @@ -110,10 +112,9 @@ void FactorGraph::push_back(const FactorGraph& factors) { /* ************************************************************************* */ template Ordering FactorGraph::keys() const { - string key; Ordering keys; - list indices_key; - FOREACH_PAIR(key, indices_key, indices_) keys.push_back(key); + transform(indices_.begin(), indices_.end(), + back_inserter(keys), _Select1st()); return keys; }