Skip to content

Commit fef1a6b

Browse files
committed
Fix review findings
1 parent f077725 commit fef1a6b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

include/cppcore/Common/TBitField.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class TBitField {
5353
/// @brief Will return the bit at the given position.
5454
/// @param[in] pos The bit position for readout.
5555
/// @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 ;
5757

5858
/// @brief Will set the bit at the given position to the given state.
5959
/// @param[in] pos The bit position for write.
@@ -76,12 +76,11 @@ class TBitField {
7676
size_t maxBits() const;
7777

7878
private:
79-
T mBitMask = 0;
79+
T mBitMask{0};
8080
};
8181

8282
template <class T>
83-
inline TBitField<T>::TBitField(T init) :
84-
mBitMask(init) {
83+
inline TBitField<T>::TBitField(T init) : mBitMask(init) {
8584
// empty
8685
}
8786

@@ -91,7 +90,7 @@ inline T TBitField<T>::getMask() const {
9190
}
9291

9392
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 {
9594
assert(pos < maxBits());
9695
return (mBitMask & (1 << pos)) != 0;
9796
}

0 commit comments

Comments
 (0)