From 4a196a34ce55d77a60450a6054f31d8f68580185 Mon Sep 17 00:00:00 2001 From: ackimixs Date: Mon, 20 May 2024 16:48:26 +0200 Subject: [PATCH] parser only for number --- components/CLParser/include/Modelec/CLParser.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/CLParser/include/Modelec/CLParser.h b/components/CLParser/include/Modelec/CLParser.h index 479cd00..7e8c8b9 100644 --- a/components/CLParser/include/Modelec/CLParser.h +++ b/components/CLParser/include/Modelec/CLParser.h @@ -18,7 +18,7 @@ public: [[nodiscard]] std::string getOption(const std::string& option, const std::string& defaultValue) const; template - [[nodiscard]] T getOption(const std::string& option, T defaultValue) const { + [[nodiscard]] typename std::enable_if::value, T>::type getOption(const std::string& option, T defaultValue) const { if (!hasOption(option)) { return defaultValue; } @@ -31,7 +31,7 @@ public: } template - [[nodiscard]] std::optional getOption(const std::string& option) const { + [[nodiscard]] std::optional::value, T>::type> getOption(const std::string& option) const { if (!hasOption(option)) { return std::nullopt; } @@ -48,7 +48,7 @@ public: [[nodiscard]] std::string getPositionalArgument(int index) const; template - [[nodiscard]] T getPositionalArgument(int index) const { + [[nodiscard]] typename std::enable_if::value, T>::type getPositionalArgument(int index) const { if (!hasPositionalArgument(index)) { return T(); }