|
|
@ -55,7 +55,8 @@ public:
|
|
|
|
std::string msg =
|
|
|
|
std::string msg =
|
|
|
|
"ERROR: new size=" + std::to_string(new_size) + " exceeds bitset capacity=" + std::to_string(max_size());
|
|
|
|
"ERROR: new size=" + std::to_string(new_size) + " exceeds bitset capacity=" + std::to_string(max_size());
|
|
|
|
THROW_BAD_ACCESS(msg.c_str());
|
|
|
|
THROW_BAD_ACCESS(msg.c_str());
|
|
|
|
} else if (new_size == cur_size) {
|
|
|
|
}
|
|
|
|
|
|
|
|
if (new_size == cur_size) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cur_size = new_size;
|
|
|
|
cur_size = new_size;
|
|
|
@ -65,7 +66,7 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void set(size_t pos, bool val) noexcept
|
|
|
|
void set(size_t pos, bool val)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
assert_within_bounds_(pos, true);
|
|
|
|
assert_within_bounds_(pos, true);
|
|
|
|
if (val) {
|
|
|
|
if (val) {
|
|
|
@ -75,13 +76,13 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void set(size_t pos) noexcept
|
|
|
|
void set(size_t pos)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
assert_within_bounds_(pos, true);
|
|
|
|
assert_within_bounds_(pos, true);
|
|
|
|
set_(pos);
|
|
|
|
set_(pos);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void reset(size_t pos) noexcept
|
|
|
|
void reset(size_t pos)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
assert_within_bounds_(pos, true);
|
|
|
|
assert_within_bounds_(pos, true);
|
|
|
|
reset_(pos);
|
|
|
|
reset_(pos);
|
|
|
@ -94,7 +95,7 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool test(size_t pos) const noexcept
|
|
|
|
bool test(size_t pos) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
assert_within_bounds_(pos, true);
|
|
|
|
assert_within_bounds_(pos, true);
|
|
|
|
return test_(pos);
|
|
|
|
return test_(pos);
|
|
|
@ -109,7 +110,7 @@ public:
|
|
|
|
return *this;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bounded_bitset<N, reversed>& fill(size_t startpos, size_t endpos, bool value = true) noexcept
|
|
|
|
bounded_bitset<N, reversed>& fill(size_t startpos, size_t endpos, bool value = true)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
assert_within_bounds_(startpos, false);
|
|
|
|
assert_within_bounds_(startpos, false);
|
|
|
|
assert_within_bounds_(endpos, false);
|
|
|
|
assert_within_bounds_(endpos, false);
|
|
|
@ -151,7 +152,7 @@ public:
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool any(size_t start, size_t stop) const noexcept
|
|
|
|
bool any(size_t start, size_t stop) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
assert_within_bounds_(start, false);
|
|
|
|
assert_within_bounds_(start, false);
|
|
|
|
assert_within_bounds_(stop, false);
|
|
|
|
assert_within_bounds_(stop, false);
|
|
|
@ -227,7 +228,7 @@ public:
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::string to_string() const noexcept
|
|
|
|
std::string to_string() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::string s;
|
|
|
|
std::string s;
|
|
|
|
s.assign(size(), '0');
|
|
|
|
s.assign(size(), '0');
|
|
|
|