File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ class TBitField {
53
53
// / @brief Will return the bit at the given position.
54
54
// / @param[in] pos The bit position for readout.
55
55
// / @return true for bit is set, false for not.
56
- bool getBit (size_t pos) const ;
56
+ bool constexpr getBit (size_t pos) const noexcept ;
57
57
58
58
// / @brief Will set the bit at the given position to the given state.
59
59
// / @param[in] pos The bit position for write.
@@ -76,12 +76,11 @@ class TBitField {
76
76
size_t maxBits () const ;
77
77
78
78
private:
79
- T mBitMask = 0 ;
79
+ T mBitMask { 0 } ;
80
80
};
81
81
82
82
template <class T >
83
- inline TBitField<T>::TBitField(T init) :
84
- mBitMask (init) {
83
+ inline TBitField<T>::TBitField(T init) : mBitMask (init) {
85
84
// empty
86
85
}
87
86
@@ -91,7 +90,7 @@ inline T TBitField<T>::getMask() const {
91
90
}
92
91
93
92
template <class T >
94
- inline bool TBitField<T>::getBit(size_t pos) const {
93
+ inline bool constexpr TBitField<T>::getBit(size_t pos) const noexcept {
95
94
assert (pos < maxBits ());
96
95
return (mBitMask & (1 << pos)) != 0 ;
97
96
}
You can’t perform that action at this time.
0 commit comments