-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMacros.h
93 lines (74 loc) · 1.86 KB
/
Macros.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#pragma once
#include<exception>
#include<string>
#define _P_S_BEGIN namespace _panagiotis_stelios{
#define _P_S_END }
#define _NODISCARD [[nodiscard]]
struct Term {
float coefficient;
float exponent;
};
struct Term2 {
float a;
float expontential;
};
struct Term3 {
float a;
float log;
};
struct Term4 {
float a;
float sin;
};
struct Term5 {
float a;
float cos;
};
struct Term6 {
float a;
};
class _INVALID_INPUT : public std::exception {
private:
std::string errorMessage; // To store the error message
public:
// Constructor to initialize the error message
explicit _INVALID_INPUT(const std::string& message)
: errorMessage(message) {
}
// Override the what() method
const char* what() const noexcept override {
return errorMessage.c_str();
}
};
class _FAILED_LOADED_IMAGE : public std::exception {
private:
std::string errorMessage; // To store the error message
public:
// Constructor to initialize the error message
explicit _FAILED_LOADED_IMAGE(const std::string& message)
: errorMessage(message) {
}
// Override the what() method
const char* what() const noexcept override {
return errorMessage.c_str();
}
};
class _FAILED_ACTION : public std::exception {
private:
std::string errorMessage; // To store the error message
public:
// Constructor to initialize the error message
explicit _FAILED_ACTION(const std::string& message)
: errorMessage(message) {
}
// Override the what() method
const char* what() const noexcept override {
return errorMessage.c_str();
}
};
template<typename ...ts>
struct overload :ts...{
using ts::operator()...;
};
template<typename ...ts>
overload(ts...) -> overload<ts...>;