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; }