2015-07-22 13:38:36 +02:00
|
|
|
#pragma once
|
2015-10-15 12:58:16 +02:00
|
|
|
#ifndef MESSMER_CPPUTILS_ASSERT_ASSERTFAILED_H
|
|
|
|
#define MESSMER_CPPUTILS_ASSERT_ASSERTFAILED_H
|
2015-07-22 13:38:36 +02:00
|
|
|
|
|
|
|
#include <stdexcept>
|
2015-07-25 12:06:27 +02:00
|
|
|
#include <string>
|
2015-11-27 14:05:30 +01:00
|
|
|
#include "../macros.h"
|
2015-07-22 13:38:36 +02:00
|
|
|
|
|
|
|
namespace cpputils {
|
|
|
|
|
2015-11-27 14:05:30 +01:00
|
|
|
class AssertFailed final: public std::exception {
|
2015-07-22 13:38:36 +02:00
|
|
|
public:
|
|
|
|
AssertFailed(const std::string &message) : _message(message) { }
|
|
|
|
|
|
|
|
const char *what() const throw() override {
|
|
|
|
return _message.c_str();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::string _message;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|