diff --git a/gtsam/linear/JacobianFactor-inl.h b/gtsam/linear/JacobianFactor-inl.h index 302275623..06fac1a67 100644 --- a/gtsam/linear/JacobianFactor-inl.h +++ b/gtsam/linear/JacobianFactor-inl.h @@ -79,7 +79,7 @@ namespace gtsam { : keys(keys), Ab(Ab), i(i) {} template - void operator()(const std::pair& term) const + void operator()(const std::pair& term) const { // Check block rows if(term.second.rows() != Ab.rows()) @@ -91,18 +91,6 @@ namespace gtsam { ++ i; } - template - void operator()(const std::pair& term) const - { - operator()(std::pair(term)); - } - - template - void operator()(const std::pair& term) const - { - operator()(std::pair(term)); - } - template void operator()(const std::pair& term) const { diff --git a/gtsam/linear/VectorValues.h b/gtsam/linear/VectorValues.h index c8de78dca..43cf1e9ad 100644 --- a/gtsam/linear/VectorValues.h +++ b/gtsam/linear/VectorValues.h @@ -175,14 +175,14 @@ namespace gtsam { * @param value The vector to be inserted. * @param j The index with which the value will be associated. */ void insert(Key j, const Vector& value) { - insert(std::pair(j, value)); // Note only passing a reference to the Vector + insert(std::make_pair(j, value)); // Note only passing a reference to the Vector } /** Insert a vector \c value with key \c j. Throws an invalid_argument exception if the key \c * j is already used. * @param value The vector to be inserted. * @param j The index with which the value will be associated. */ - void insert(std::pair key_value) { + void insert(const std::pair& key_value) { // Note that here we accept a pair with a reference to the Vector, but the Vector is copied as // it is inserted into the values_ map. if(!values_.insert(key_value).second)