diff options
Diffstat (limited to 'vendor/bandit/bandit/assertion_exception.h')
-rw-r--r-- | vendor/bandit/bandit/assertion_exception.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/vendor/bandit/bandit/assertion_exception.h b/vendor/bandit/bandit/assertion_exception.h new file mode 100644 index 00000000..9abc9867 --- /dev/null +++ b/vendor/bandit/bandit/assertion_exception.h @@ -0,0 +1,41 @@ +#ifndef BANDIT_ASSERTION_EXCEPTION_H +#define BANDIT_ASSERTION_EXCEPTION_H + +namespace bandit { namespace detail { + + struct assertion_exception : public std::runtime_error + { + assertion_exception(const std::string& message, + const std::string& filename, const unsigned int linenumber) + : std::runtime_error(message), file_name_(filename), line_number_(linenumber) + {} + + assertion_exception(const std::string& message) + : std::runtime_error(message), line_number_(0) + {} + + // + // To make gcc < 4.7 happy. + // + assertion_exception(const assertion_exception&) = default; + assertion_exception(assertion_exception&&) = default; + virtual ~assertion_exception() noexcept + {} + + const std::string& file_name() const + { + return file_name_; + } + + unsigned int line_number() const + { + return line_number_; + } + + private: + std::string file_name_; + unsigned int line_number_; + }; +}} + +#endif |