diff --git a/src/bind/bindinglist.cpp b/src/bind/bindinglist.cpp index 4284a24c..25645220 100644 --- a/src/bind/bindinglist.cpp +++ b/src/bind/bindinglist.cpp @@ -319,5 +319,10 @@ namespace vind BindedFunc::SPtr search_func(const std::string& name) { return search_func(BindedFunc::name_to_id(util::A2a(name))) ; } + + BindedFunc::SPtr search_func(std::string&& name) { + return search_func( + BindedFunc::name_to_id(util::A2a(std::move(name)))) ; + } } } diff --git a/src/bind/bindinglist.hpp b/src/bind/bindinglist.hpp index e89ac59a..b5a330c4 100644 --- a/src/bind/bindinglist.hpp +++ b/src/bind/bindinglist.hpp @@ -13,10 +13,11 @@ namespace vind BindedFunc::SPtr search_func(std::size_t id) ; BindedFunc::SPtr search_func(const std::string& name) ; + BindedFunc::SPtr search_func(std::string&& name) ; template inline bool check_if_func(T&& arg) { - return search_func(arg) != nullptr ; + return search_func(std::forward(arg)) != nullptr ; } } } diff --git a/src/opt/optionlist.hpp b/src/opt/optionlist.hpp index 151654e8..8459f8bf 100644 --- a/src/opt/optionlist.hpp +++ b/src/opt/optionlist.hpp @@ -37,7 +37,7 @@ namespace vind template inline bool check_if_option(T&& name) { - return search_option(name) != nullptr ; + return search_option(std::forward(name)).get() != nullptr ; } } }