From f1a93a0e613e46121039f8aa1415bb8f02946cf9 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 6 Aug 2016 06:52:11 +0100 Subject: [PATCH] Replace some const String& with StringView in option_manager.hh --- src/option_manager.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/option_manager.hh b/src/option_manager.hh index 4824f88c..9fb57c8d 100644 --- a/src/option_manager.hh +++ b/src/option_manager.hh @@ -211,7 +211,7 @@ public: OptionsRegistry(OptionManager& global_manager) : m_global_manager(global_manager) {} template - Option& declare_option(const String& name, const String& docstring, + Option& declare_option(StringView name, StringView docstring, const T& value, OptionFlags flags = OptionFlags::None) { @@ -223,7 +223,7 @@ public: return **it; throw runtime_error(format("option '{}' already declared with different type or flags", name)); } - m_descs.emplace_back(new OptionDesc{name, docstring, flags}); + m_descs.emplace_back(new OptionDesc{name.str(), docstring.str(), flags}); opts.emplace_back(new TypedCheckedOption{m_global_manager, *m_descs.back(), value}); return *opts.back(); }