util/OptionParser: add "constexpr"

This commit is contained in:
Max Kellermann 2018-01-16 10:12:38 +01:00
parent 42c1fe963b
commit 36a6405e8b

View File

@ -39,13 +39,15 @@ public:
/**
* Constructs #OptionParser.
*/
OptionParser(int _argc, char **_argv) noexcept
constexpr OptionParser(int _argc, char **_argv) noexcept
:argc(_argc - 1), argv(_argv + 1) {}
/**
* Checks if there are command line entries to process.
*/
bool HasEntries() const noexcept { return argc > 0; }
constexpr bool HasEntries() const noexcept {
return argc > 0;
}
/**
* Gets the last parsed option.