Opts: Solve OptionsParser::Exception diamond inheritance problem
This commit is contained in:
@@ -29,9 +29,13 @@ public:
|
||||
class Exception : public std::exception
|
||||
{
|
||||
public:
|
||||
Exception() = default;
|
||||
explicit Exception(std::string message_);
|
||||
~Exception() override = default;
|
||||
const char* what() const noexcept override = 0;
|
||||
|
||||
const char* what() const noexcept override;
|
||||
|
||||
protected:
|
||||
std::string message;
|
||||
};
|
||||
|
||||
std::string argv0;
|
||||
@@ -45,13 +49,11 @@ public:
|
||||
};
|
||||
|
||||
class OptionsParserError
|
||||
: public std::invalid_argument, public OptionParser::Exception
|
||||
: public OptionParser::Exception
|
||||
{
|
||||
public:
|
||||
OptionsParserError(
|
||||
const std::string& errorMessage, const OptionParser& parser);
|
||||
|
||||
const char* what() const noexcept override;
|
||||
};
|
||||
|
||||
class JustPrintUsageNoError
|
||||
@@ -59,10 +61,6 @@ class JustPrintUsageNoError
|
||||
{
|
||||
public:
|
||||
explicit JustPrintUsageNoError(const OptionParser& parser);
|
||||
const char* what() const noexcept override;
|
||||
|
||||
private:
|
||||
std::string message;
|
||||
};
|
||||
|
||||
#endif // OPTS_H
|
||||
|
||||
Reference in New Issue
Block a user