Skip to content

Commit

Permalink
A few more explicit constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Apr 13, 2018
1 parent b232753 commit bd890e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/CLI/Error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class CallForHelp : public ParseError {
/// Does not output a diagnostic in CLI11_PARSE, but allows to return from main() with a specific error code.
class RuntimeError : public ParseError {
CLI11_ERROR_DEF(ParseError, RuntimeError)
RuntimeError(int exit_code = 1) : RuntimeError("Runtime error", exit_code) {}
explicit RuntimeError(int exit_code = 1) : RuntimeError("Runtime error", exit_code) {}
};

/// Thrown when parsing an INI file and it is missing
Expand Down Expand Up @@ -242,7 +242,7 @@ class ExcludesError : public ParseError {
/// Thrown when too many positionals or options are found
class ExtrasError : public ParseError {
CLI11_ERROR_DEF(ParseError, ExtrasError)
ExtrasError(std::vector<std::string> args)
explicit ExtrasError(std::vector<std::string> args)
: ExtrasError((args.size() > 1 ? "The following arguments were not expected: "
: "The following argument was not expected: ") +
detail::rjoin(args, " "),
Expand Down Expand Up @@ -279,7 +279,7 @@ class HorribleError : public ParseError {
/// Thrown when counting a non-existent option
class OptionNotFound : public Error {
CLI11_ERROR_DEF(Error, OptionNotFound)
OptionNotFound(std::string name) : OptionNotFound(name + " not found", ExitCodes::OptionNotFound) {}
explicit OptionNotFound(std::string name) : OptionNotFound(name + " not found", ExitCodes::OptionNotFound) {}
};

/// @}
Expand Down

0 comments on commit bd890e2

Please sign in to comment.