From 120f1301c21276bf0ec12a3d52c06fd3b7147ec6 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Sun, 10 Jan 2010 17:01:48 +0000 Subject: [PATCH] operator[] --- cpp/LieConfig.h | 5 +++++ 1 file changed, 5 insertions(+) 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);