libcryfs/assert/AssertFailed.h

26 lines
494 B
C
Raw Normal View History

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>
#include <string>
#include "../macros.h"
2015-07-22 13:38:36 +02:00
namespace cpputils {
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