X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/46b0747592074017ff0ea4b33d4a7194235886e5..c7801cde8b95a9ef8318030e1caaa0be0603fe80:/sgconf/options.cpp?ds=sidebyside

diff --git a/sgconf/options.cpp b/sgconf/options.cpp
index 49e04d64..e431bcb0 100644
--- a/sgconf/options.cpp
+++ b/sgconf/options.cpp
@@ -198,7 +198,7 @@ if (!m_description.empty())
     std::cout << m_description << ":\n";
 std::for_each(m_options.begin(),
               m_options.end(),
-              std::bind2nd(std::mem_fun_ref(&OPTION::Help), level + 1));
+              [&level](const auto& opt){ opt.Help(level + 1); });
 }
 
 PARSER_STATE OPTION_BLOCK::Parse(int argc, char ** argv, void * data)
@@ -208,12 +208,11 @@ if (state.argc == 0)
     return state;
 while (state.argc > 0 && !state.stop)
     {
-    std::vector<OPTION>::iterator it = std::find_if(m_options.begin(), m_options.end(), std::bind2nd(std::mem_fun_ref(&OPTION::Check), *state.argv));
+    const auto it = std::find_if(m_options.begin(), m_options.end(), [&state](const auto& opt){ return opt.Check(*state.argv); });
     if (it != m_options.end())
         state = it->Parse(--state.argc, ++state.argv, data);
     else
         break;
-    ++it;
     }
 return state;
 }