diff --git a/include/ss/converter.hpp b/include/ss/converter.hpp index b9c7c45..aadc797 100644 --- a/include/ss/converter.hpp +++ b/include/ss/converter.hpp @@ -169,6 +169,8 @@ public: bool valid() const { if constexpr (string_error) { return error_.empty(); + } else if constexpr (throw_on_error) { + return true; } else { return !error_; } diff --git a/include/ss/parser.hpp b/include/ss/parser.hpp index fcb1b5a..d084d94 100644 --- a/include/ss/parser.hpp +++ b/include/ss/parser.hpp @@ -63,6 +63,8 @@ public: bool valid() const { if constexpr (string_error) { return error_.empty(); + } else if constexpr (throw_on_error) { + return true; } else { return !error_; } diff --git a/include/ss/splitter.hpp b/include/ss/splitter.hpp index 87e1ac0..091e3c8 100644 --- a/include/ss/splitter.hpp +++ b/include/ss/splitter.hpp @@ -34,6 +34,8 @@ public: bool valid() const { if constexpr (string_error) { return error_.empty(); + } else if constexpr (throw_on_error) { + return true; } else { return !error_; }