Remove u8 prefix in string literals. (#172)

String literals with the prefix `u8` now have the type `const char8_t[N]` in
C++20. As a consequence the library does not compile in c++2a mode with GCC
(you can't concatenate `std::basic_string<char>` and `const char8_t[]` as
`char` and `char8_t` are different types).
This commit is contained in:
le-migou 2019-04-15 10:26:43 +02:00 committed by jarro2783
parent 3876c09072
commit 48e265dc4b

View File

@ -354,7 +354,7 @@ namespace cxxopts
{ {
public: public:
option_exists_error(const std::string& option) option_exists_error(const std::string& option)
: OptionSpecException(u8"Option " + LQUOTE + option + RQUOTE + u8" already exists") : OptionSpecException("Option " + LQUOTE + option + RQUOTE + " already exists")
{ {
} }
}; };
@ -363,7 +363,7 @@ namespace cxxopts
{ {
public: public:
invalid_option_format_error(const std::string& format) invalid_option_format_error(const std::string& format)
: OptionSpecException(u8"Invalid option format " + LQUOTE + format + RQUOTE) : OptionSpecException("Invalid option format " + LQUOTE + format + RQUOTE)
{ {
} }
}; };
@ -371,8 +371,8 @@ namespace cxxopts
class option_syntax_exception : public OptionParseException { class option_syntax_exception : public OptionParseException {
public: public:
option_syntax_exception(const std::string& text) option_syntax_exception(const std::string& text)
: OptionParseException(u8"Argument " + LQUOTE + text + RQUOTE + : OptionParseException("Argument " + LQUOTE + text + RQUOTE +
u8" starts with a - but has incorrect syntax") " starts with a - but has incorrect syntax")
{ {
} }
}; };
@ -381,7 +381,7 @@ namespace cxxopts
{ {
public: public:
option_not_exists_exception(const std::string& option) option_not_exists_exception(const std::string& option)
: OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" does not exist") : OptionParseException("Option " + LQUOTE + option + RQUOTE + " does not exist")
{ {
} }
}; };
@ -391,7 +391,7 @@ namespace cxxopts
public: public:
missing_argument_exception(const std::string& option) missing_argument_exception(const std::string& option)
: OptionParseException( : OptionParseException(
u8"Option " + LQUOTE + option + RQUOTE + u8" is missing an argument" "Option " + LQUOTE + option + RQUOTE + " is missing an argument"
) )
{ {
} }
@ -402,7 +402,7 @@ namespace cxxopts
public: public:
option_requires_argument_exception(const std::string& option) option_requires_argument_exception(const std::string& option)
: OptionParseException( : OptionParseException(
u8"Option " + LQUOTE + option + RQUOTE + u8" requires an argument" "Option " + LQUOTE + option + RQUOTE + " requires an argument"
) )
{ {
} }
@ -417,8 +417,8 @@ namespace cxxopts
const std::string& arg const std::string& arg
) )
: OptionParseException( : OptionParseException(
u8"Option " + LQUOTE + option + RQUOTE + "Option " + LQUOTE + option + RQUOTE +
u8" does not take an argument, but argument " + " does not take an argument, but argument " +
LQUOTE + arg + RQUOTE + " given" LQUOTE + arg + RQUOTE + " given"
) )
{ {
@ -429,7 +429,7 @@ namespace cxxopts
{ {
public: public:
option_not_present_exception(const std::string& option) option_not_present_exception(const std::string& option)
: OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" not present") : OptionParseException("Option " + LQUOTE + option + RQUOTE + " not present")
{ {
} }
}; };
@ -442,7 +442,7 @@ namespace cxxopts
const std::string& arg const std::string& arg
) )
: OptionParseException( : OptionParseException(
u8"Argument " + LQUOTE + arg + RQUOTE + u8" failed to parse" "Argument " + LQUOTE + arg + RQUOTE + " failed to parse"
) )
{ {
} }
@ -453,7 +453,7 @@ namespace cxxopts
public: public:
option_required_exception(const std::string& option) option_required_exception(const std::string& option)
: OptionParseException( : OptionParseException(
u8"Option " + LQUOTE + option + RQUOTE + u8" is required but not present" "Option " + LQUOTE + option + RQUOTE + " is required but not present"
) )
{ {
} }