u128: Make Bit() a const-qualified member function

This function doesn't modify the struct members, so it can be made
const.
This commit is contained in:
Lioncash 2018-07-23 17:52:52 -04:00 committed by MerryMage
parent b2e4c16ef8
commit 3ca18d8a6d

View file

@ -34,7 +34,7 @@ struct u128 {
u64 upper = 0; u64 upper = 0;
template<size_t bit_position> template<size_t bit_position>
bool Bit() { bool Bit() const {
static_assert(bit_position < 128); static_assert(bit_position < 128);
if constexpr (bit_position < 64) { if constexpr (bit_position < 64) {
return Common::Bit<bit_position>(lower); return Common::Bit<bit_position>(lower);