mirror of
https://github.com/boostorg/dynamic_bitset.git
synced 2026-01-23 17:42:12 +00:00
Compare commits
6 Commits
boost-1.65
...
boost-1.68
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f54d83981 | ||
|
|
4cac68e762 | ||
|
|
d3eb4faf0c | ||
|
|
3f3662d39d | ||
|
|
184d1ba7ad | ||
|
|
5b39db5ba0 |
@@ -1,11 +1,12 @@
|
||||
// -----------------------------------------------------------
|
||||
// Copyright (c) 2002 Gennaro Prota
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// -----------------------------------------------------------
|
||||
# -----------------------------------------------------------
|
||||
# Copyright (c) 2002 Gennaro Prota
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
#
|
||||
# -----------------------------------------------------------
|
||||
|
||||
exe timing_tests
|
||||
: timing_tests.cpp
|
||||
;
|
||||
|
||||
@@ -977,7 +977,7 @@ template <typename Block, typename Allocator>
|
||||
dynamic_bitset<Block, Allocator>&
|
||||
dynamic_bitset<Block, Allocator>::set()
|
||||
{
|
||||
std::fill(m_bits.begin(), m_bits.end(), ~Block(0));
|
||||
std::fill(m_bits.begin(), m_bits.end(), static_cast<Block>(~0));
|
||||
m_zero_unused_bits();
|
||||
return *this;
|
||||
}
|
||||
@@ -1056,7 +1056,7 @@ bool dynamic_bitset<Block, Allocator>::all() const
|
||||
}
|
||||
|
||||
const block_width_type extra_bits = count_extra_bits();
|
||||
block_type const all_ones = ~static_cast<Block>(0);
|
||||
block_type const all_ones = static_cast<Block>(~0);
|
||||
|
||||
if (extra_bits == 0) {
|
||||
for (size_type i = 0, e = num_blocks(); i < e; ++i) {
|
||||
@@ -1070,7 +1070,7 @@ bool dynamic_bitset<Block, Allocator>::all() const
|
||||
return false;
|
||||
}
|
||||
}
|
||||
block_type const mask = ~(~static_cast<Block>(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<Block, Allocator>::m_zero_unused_bits()
|
||||
const block_width_type extra_bits = count_extra_bits();
|
||||
|
||||
if (extra_bits != 0)
|
||||
m_highest_block() &= ~(~static_cast<Block>(0) << extra_bits);
|
||||
|
||||
m_highest_block() &= (Block(1) << extra_bits) - 1;
|
||||
}
|
||||
|
||||
// check class invariants
|
||||
@@ -1950,7 +1949,7 @@ bool dynamic_bitset<Block, Allocator>::m_check_invariants() const
|
||||
{
|
||||
const block_width_type extra_bits = count_extra_bits();
|
||||
if (extra_bits > 0) {
|
||||
block_type const mask = (~static_cast<Block>(0) << extra_bits);
|
||||
const block_type mask = block_type(~0) << extra_bits;
|
||||
if ((m_highest_block() & mask) != 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#define BOOST_LOWEST_BIT_HPP_GP_20030301
|
||||
|
||||
#include <assert.h>
|
||||
#include "boost/pending/integer_log2.hpp"
|
||||
#include "boost/integer/integer_log2.hpp"
|
||||
|
||||
|
||||
namespace boost {
|
||||
|
||||
Reference in New Issue
Block a user