diff --git a/cpp/NonlinearFactor.h b/cpp/NonlinearFactor.h index 7d2b4adbe..229df2285 100644 --- a/cpp/NonlinearFactor.h +++ b/cpp/NonlinearFactor.h @@ -65,7 +65,7 @@ namespace gtsam { /** get functions */ double get_sigma() const {return sigma_;} Vector get_measurement() const {return z_;} - std::list get_keys() const {return keys_;} + const std::list& get_keys() const {return keys_;} void set_keys(std::list keys) {keys_ = keys;} /** calculate the error of the factor */