From 36a6405e8b9da2408d9b25168bc328828dc9fd78 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 16 Jan 2018 10:12:38 +0100 Subject: [PATCH] util/OptionParser: add "constexpr" --- src/util/OptionParser.hxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util/OptionParser.hxx b/src/util/OptionParser.hxx index c83e8b36c..06ca6ba7a 100644 --- a/src/util/OptionParser.hxx +++ b/src/util/OptionParser.hxx @@ -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.