From 5a7176740ab8ed7c94692b254eed3d80a52f836a Mon Sep 17 00:00:00 2001 From: gereon Date: Sun, 2 Dec 2012 10:18:34 +0100 Subject: [PATCH] adding generic get() method for settings of arbitrary type --- src/utility/settings.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/utility/settings.h b/src/utility/settings.h index 647b869f1..be38fb28a 100644 --- a/src/utility/settings.h +++ b/src/utility/settings.h @@ -37,11 +37,19 @@ namespace settings { { public: + /*! + * @brief Get value of a generic option. + */ + template + const T& get(const std::string &name) const { + return this->vm[name].as(); + } + /*! * @brief Get value of string option */ const std::string& getString(const std::string &name) const { - return this->vm[name].as(); + return this->get(name); } /*!