diff options
Diffstat (limited to 'include/armnn/Exceptions.hpp')
-rw-r--r-- | include/armnn/Exceptions.hpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/armnn/Exceptions.hpp b/include/armnn/Exceptions.hpp index cb62079b76..05b740614d 100644 --- a/include/armnn/Exceptions.hpp +++ b/include/armnn/Exceptions.hpp @@ -143,6 +143,13 @@ public: using Exception::Exception; }; +class PolymorphicDowncastException : public Exception +{ +public: + using Exception::Exception; +}; + + template <typename ExceptionType> void ConditionalThrow(bool condition, const std::string& message) { @@ -152,6 +159,16 @@ void ConditionalThrow(bool condition, const std::string& message) } } +template <typename ExceptionType> +void ConditionalThrow(bool condition) +{ + if (!condition) + { + throw ExceptionType(); + } +} + + /// /// ComparedType must support: /// operator==(const ComparedType&) |