10
10
struct AlignFlags {
11
11
uint8_t bits;
12
12
13
- explicit operator bool () const {
13
+ constexpr explicit operator bool () const {
14
14
return !!bits;
15
15
}
16
- AlignFlags operator ~() const {
16
+ constexpr AlignFlags operator ~() const {
17
17
return {static_cast <decltype (bits)>(~bits)};
18
18
}
19
- AlignFlags operator |(const AlignFlags& other) const {
19
+ constexpr AlignFlags operator |(const AlignFlags& other) const {
20
20
return {static_cast <decltype (bits)>(this ->bits | other.bits )};
21
21
}
22
22
AlignFlags& operator |=(const AlignFlags& other) {
23
23
*this = (*this | other);
24
24
return *this ;
25
25
}
26
- AlignFlags operator &(const AlignFlags& other) const {
26
+ constexpr AlignFlags operator &(const AlignFlags& other) const {
27
27
return {static_cast <decltype (bits)>(this ->bits & other.bits )};
28
28
}
29
29
AlignFlags& operator &=(const AlignFlags& other) {
30
30
*this = (*this & other);
31
31
return *this ;
32
32
}
33
- AlignFlags operator ^(const AlignFlags& other) const {
33
+ constexpr AlignFlags operator ^(const AlignFlags& other) const {
34
34
return {static_cast <decltype (bits)>(this ->bits ^ other.bits )};
35
35
}
36
36
AlignFlags& operator ^=(const AlignFlags& other) {
@@ -55,27 +55,27 @@ constexpr static const AlignFlags AlignFlags_MIXED_SELF = AlignFlags{ /* .bits =
55
55
struct DebugFlags {
56
56
uint32_t bits;
57
57
58
- explicit operator bool () const {
58
+ constexpr explicit operator bool () const {
59
59
return !!bits;
60
60
}
61
- DebugFlags operator ~() const {
61
+ constexpr DebugFlags operator ~() const {
62
62
return {static_cast <decltype (bits)>(~bits)};
63
63
}
64
- DebugFlags operator |(const DebugFlags& other) const {
64
+ constexpr DebugFlags operator |(const DebugFlags& other) const {
65
65
return {static_cast <decltype (bits)>(this ->bits | other.bits )};
66
66
}
67
67
DebugFlags& operator |=(const DebugFlags& other) {
68
68
*this = (*this | other);
69
69
return *this ;
70
70
}
71
- DebugFlags operator &(const DebugFlags& other) const {
71
+ constexpr DebugFlags operator &(const DebugFlags& other) const {
72
72
return {static_cast <decltype (bits)>(this ->bits & other.bits )};
73
73
}
74
74
DebugFlags& operator &=(const DebugFlags& other) {
75
75
*this = (*this & other);
76
76
return *this ;
77
77
}
78
- DebugFlags operator ^(const DebugFlags& other) const {
78
+ constexpr DebugFlags operator ^(const DebugFlags& other) const {
79
79
return {static_cast <decltype (bits)>(this ->bits ^ other.bits )};
80
80
}
81
81
DebugFlags& operator ^=(const DebugFlags& other) {
@@ -89,27 +89,27 @@ constexpr static const DebugFlags DebugFlags_BIGGEST_ALLOWED = DebugFlags{ /* .b
89
89
struct LargeFlags {
90
90
uint64_t bits;
91
91
92
- explicit operator bool () const {
92
+ constexpr explicit operator bool () const {
93
93
return !!bits;
94
94
}
95
- LargeFlags operator ~() const {
95
+ constexpr LargeFlags operator ~() const {
96
96
return {static_cast <decltype (bits)>(~bits)};
97
97
}
98
- LargeFlags operator |(const LargeFlags& other) const {
98
+ constexpr LargeFlags operator |(const LargeFlags& other) const {
99
99
return {static_cast <decltype (bits)>(this ->bits | other.bits )};
100
100
}
101
101
LargeFlags& operator |=(const LargeFlags& other) {
102
102
*this = (*this | other);
103
103
return *this ;
104
104
}
105
- LargeFlags operator &(const LargeFlags& other) const {
105
+ constexpr LargeFlags operator &(const LargeFlags& other) const {
106
106
return {static_cast <decltype (bits)>(this ->bits & other.bits )};
107
107
}
108
108
LargeFlags& operator &=(const LargeFlags& other) {
109
109
*this = (*this & other);
110
110
return *this ;
111
111
}
112
- LargeFlags operator ^(const LargeFlags& other) const {
112
+ constexpr LargeFlags operator ^(const LargeFlags& other) const {
113
113
return {static_cast <decltype (bits)>(this ->bits ^ other.bits )};
114
114
}
115
115
LargeFlags& operator ^=(const LargeFlags& other) {
0 commit comments