diff --git a/include/CLI/App.hpp b/include/CLI/App.hpp index 6bad4201..686e3ccf 100644 --- a/include/CLI/App.hpp +++ b/include/CLI/App.hpp @@ -1048,16 +1048,20 @@ namespace detail { /// This class is simply to allow tests access to App's protected functions struct AppFriend { - /// Wrap _parse_short - static void parse_short(App* app, std::vector &args) { - return app->_parse_short(args); + /// Wrap _parse_short, perfectly forward arguments and return + template + static auto parse_short(App* app, Args && ...args) + -> typename std::result_of::type { + return app->_parse_short(std::forward(args)...); } - /// Wrap _parse_long - static void parse_long(App* app, std::vector &args) { - return app->_parse_long(args); + + /// Wrap _parse_long, perfectly forward arguments and return + template + static auto parse_long(App* app, Args && ...args) + -> typename std::result_of::type { + return app->_parse_long(std::forward(args)...); } - }; }