scsl 0.2.4
Shimmering Clarity Standard Library
Exceptions.h
Go to the documentation of this file.
1
22#ifndef SCSL_EXCEPTIONS_H
23#define SCSL_EXCEPTIONS_H
24
25
26#include <exception>
27#include <string>
28
29
30namespace scsl {
31
32
37class NotImplemented : public std::exception {
38public:
40 explicit NotImplemented(const char *pl) : platform((char *)pl) {}
41
43 const char *what() const throw() {
44 return this->platform;
45 }
46private:
47 char *platform;
48};
49
50
52class AssertionFailed : public std::exception {
53public:
56 explicit AssertionFailed(std::string message);
57
59 const char *what() const throw();
60
61private:
62 std::string msg;
63};
64
65
66} // namespace scsl
67
68
69#endif //SCSL_EXCEPTIONS_H
AssertionFailed indicates that some invariant didn't hold.
Definition: Exceptions.h:52
AssertionFailed(std::string message)
Definition: Exceptions.cc:29
const char * what() const
what returns a message describing the exception.
Definition: Exceptions.cc:34
Definition: Exceptions.h:37
const char * what() const
what returns a message naming the platform.
Definition: Exceptions.h:43
NotImplemented(const char *pl)
NotImplemented exceptions are constructed with a platform name.
Definition: Exceptions.h:40
scsl is the top-level namespace containing all the code in this library.
Definition: scsl.h:43