Browse Source

adding generic get() method for settings of arbitrary type

tempestpy_adaptions
gereon 12 years ago
parent
commit
5a7176740a
  1. 10
      src/utility/settings.h

10
src/utility/settings.h

@ -37,11 +37,19 @@ namespace settings {
{ {
public: public:
/*!
* @brief Get value of a generic option.
*/
template <typename T>
const T& get(const std::string &name) const {
return this->vm[name].as<T>();
}
/*! /*!
* @brief Get value of string option * @brief Get value of string option
*/ */
const std::string& getString(const std::string &name) const { const std::string& getString(const std::string &name) const {
return this->vm[name].as<std::string>();
return this->get<std::string>(name);
} }
/*! /*!

Loading…
Cancel
Save