-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathexceptions.h
42 lines (38 loc) · 947 Bytes
/
exceptions.h
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
40
41
42
/**
* @file exceptions.h
* @brief A file with a class for DMRG exceptions
*
* @author Roger Melko
* @author Ivan Gonzalez
* @date $Date$
*
* $Revision$
*
* This file defines a class for exceptions derived from std::logic_error
* to be used anywhere in the code
*/
#ifndef EXCEPTION_H
#define EXCEPTION_H
#include<stdexcept>
namespace dmrg{
/**
* @brief A class for exceptions to be thrown by our code
*
* We derived our exception from std::logic_error and not other
* std::exception for no reason.
*
* @see Josuttis C++ Standard Library (sec 3.3)
*/
class Exception : public std::logic_error {
public:
/**
* brief Constructor
*
* @param whatString a string with the message the exception
* will print out if raised.
*/
Exception(const std::string& whatString)
: std::logic_error(whatString) {}
};
} //namespace dmrg
#endif // EXCEPTION_H