From b8cf34c691623e4ec329053cbbf68522a855882d Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Thu, 5 Dec 2019 15:12:59 +0900 Subject: Imported Upstream version 1.67.0 --- boost/dynamic_bitset/dynamic_bitset.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'boost/dynamic_bitset') diff --git a/boost/dynamic_bitset/dynamic_bitset.hpp b/boost/dynamic_bitset/dynamic_bitset.hpp index 135070d167..83fcb61a1e 100644 --- a/boost/dynamic_bitset/dynamic_bitset.hpp +++ b/boost/dynamic_bitset/dynamic_bitset.hpp @@ -1070,7 +1070,7 @@ bool dynamic_bitset::all() const return false; } } - block_type const mask = ~(~static_cast(0) << extra_bits); + const block_type mask = (block_type(1) << extra_bits) - 1; if (m_highest_block() != mask) { return false; } @@ -1940,8 +1940,7 @@ inline void dynamic_bitset::m_zero_unused_bits() const block_width_type extra_bits = count_extra_bits(); if (extra_bits != 0) - m_highest_block() &= ~(~static_cast(0) << extra_bits); - + m_highest_block() &= (Block(1) << extra_bits) - 1; } // check class invariants @@ -1950,7 +1949,7 @@ bool dynamic_bitset::m_check_invariants() const { const block_width_type extra_bits = count_extra_bits(); if (extra_bits > 0) { - block_type const mask = (~static_cast(0) << extra_bits); + const block_type mask = block_type(~0) << extra_bits; if ((m_highest_block() & mask) != 0) return false; } -- cgit v1.2.3