Skip to content
Snippets Groups Projects
Unverified Commit 55a022d9 authored by Bensong Liu's avatar Bensong Liu
Browse files

fix msvc compilation issue on opt_parser::getValueArg overloading

parent 057da7e3
No related branches found
No related tags found
No related merge requests found
...@@ -78,9 +78,7 @@ namespace rlib { ...@@ -78,9 +78,7 @@ namespace rlib {
return *pos; return *pos;
} }
} }
rlib::string getValueArg(const std::string &longName, const std::string &shortName, bool required = true, const std::string &def = std::string())
// rlib::string getValueArg(const std::string &longName, const std::string &shortName, bool required = true, const std::string &def = std::string()) // MSVC doesn't allow this overload.
rlib::string getValueArg(const std::string &longName, const std::string &shortName, bool required, const std::string &def)
{ {
using rlib::literals::operator "" _format; using rlib::literals::operator "" _format;
std::string valueL = getValueArg(longName, false); std::string valueL = getValueArg(longName, false);
...@@ -95,16 +93,13 @@ namespace rlib { ...@@ -95,16 +93,13 @@ namespace rlib {
} }
return std::move(value); return std::move(value);
} }
rlib::string getValueArg(const std::string &longName, const std::string &shortName, bool required) {
return getValueArg(longName, shortName, required, std::string());
}
rlib::string getValueArg(const std::string &longName, const std::string &shortName) {
return getValueArg(longName, shortName, true, std::string());
}
rlib::string getValueArg(const std::string &longName, const char *shortName) rlib::string getValueArg(const std::string &longName, const char *shortName)
{ //getValueArg("--long", "-l") may be converted to getValueArg("--long", true). { //getValueArg("--long", "-l") may be converted to getValueArg("--long", true).
return getValueArg(longName, shortName, true); return getValueArg(longName, std::string(shortName));
}
rlib::string getValueArg(const std::string& argName, bool required, const char * def) {
return getValueArg(argName, required, std::string(def));
} }
bool getBoolArg(const std::string &argName) bool getBoolArg(const std::string &argName)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment