sisi4s
Loading...
Searching...
No Matches
StaticAssert.hpp
Go to the documentation of this file.
1#ifndef STATIC_ASSERT_DEFINED
2#define STATIC_ASSERT_DEFINED
3
4#include <math/Complex.hpp>
5
6namespace sisi4s {
7template <typename T>
9public:
10 enum { FALSE = false };
11};
12
13template <typename A, typename B>
15public:
16 enum { EQUALS = false, POINTER_TO = false, CASTABLE_TO = false };
17};
18template <typename A>
19class TypeRelations<A, A> {
20public:
21 enum { EQUALS = true, POINTER_TO = false, CASTABLE_TO = true };
22};
23template <typename A>
24class TypeRelations<A *, A> {
25public:
26 enum { EQUALS = false, POINTER_TO = true, CASTABLE_TO = false };
27};
28
29template <>
30class TypeRelations<int, double> {
31public:
32 enum { EQUALS = false, POINTER_TO = false, CASTABLE_TO = true };
33};
34template <>
36public:
37 enum { EQUALS = false, POINTER_TO = false, CASTABLE_TO = true };
38};
39template <>
40class TypeRelations<double, complex> {
41public:
42 enum { EQUALS = false, POINTER_TO = false, CASTABLE_TO = true };
43};
44} // namespace sisi4s
45
46#endif
Definition StaticAssert.hpp:8
@ FALSE
Definition StaticAssert.hpp:10
Definition StaticAssert.hpp:14
@ POINTER_TO
Definition StaticAssert.hpp:16
@ EQUALS
Definition StaticAssert.hpp:16
@ CASTABLE_TO
Definition StaticAssert.hpp:16
Definition Algorithm.hpp:10
Complex< real > complex
Definition Complex.hpp:17