diff --git a/cpp/LieConfig.h b/cpp/LieConfig.h index 4483c1a1f..f0d3ba78c 100644 --- a/cpp/LieConfig.h +++ b/cpp/LieConfig.h @@ -63,6 +63,11 @@ namespace gtsam { else return it->second; } + /** operator[] syntax for get */ + inline const T& operator[](const std::string& name) const { + return get(name); + } + /** Retrieve a variable by key, returns nothing if not found */ boost::optional gettry(const std::string& key) const { const_iterator it = values_.find(key);