blob: 33d7474fc098e320869fb88c09b5f9edd6b4506d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#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& file_name, const unsigned int line_number)
: std::runtime_error(message), file_name_(file_name), line_number_(line_number)
{}
assertion_exception(const std::string& message)
: std::runtime_error(message), line_number_(0)
{}
//
// To make gcc < 4.7 happy.
//
virtual ~assertion_exception() throw()
{}
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
|