Opts: Solve OptionsParser::Exception diamond inheritance problem
This commit is contained in:
+12
-12
@@ -10,28 +10,28 @@
|
||||
#include <spinscale/callableTracer.h>
|
||||
|
||||
|
||||
OptionParser::Exception::Exception(std::string message_)
|
||||
: message(std::move(message_))
|
||||
{
|
||||
}
|
||||
|
||||
const char* OptionParser::Exception::what() const noexcept
|
||||
{
|
||||
return message.c_str();
|
||||
}
|
||||
|
||||
OptionsParserError::OptionsParserError(
|
||||
const std::string& errorMessage, const OptionParser& parser
|
||||
)
|
||||
: std::invalid_argument(errorMessage + "\n" + parser.getUsage())
|
||||
: OptionParser::Exception(errorMessage + "\n" + parser.getUsage())
|
||||
{
|
||||
}
|
||||
|
||||
const char* OptionsParserError::what() const noexcept
|
||||
{
|
||||
return std::invalid_argument::what();
|
||||
}
|
||||
|
||||
JustPrintUsageNoError::JustPrintUsageNoError(const OptionParser& parser)
|
||||
: message(parser.getUsage())
|
||||
: OptionParser::Exception(parser.getUsage())
|
||||
{
|
||||
}
|
||||
|
||||
const char* JustPrintUsageNoError::what() const noexcept
|
||||
{
|
||||
return message.c_str();
|
||||
}
|
||||
|
||||
struct option OptionParser::longOptions[] = {
|
||||
{"dapspec", required_argument, 0, 's'},
|
||||
{"spec", required_argument, 0, 's'},
|
||||
|
||||
Reference in New Issue
Block a user