add all_set() function on bitfield and automatically call inc_refcount_all or dec_refcount_all if all bits are set in a bitfield

This commit is contained in:
Arvid Norberg
2012-05-02 18:55:58 +00:00
parent ada35c021a
commit 10b64a7761
3 changed files with 34 additions and 2 deletions

View File

@@ -1797,6 +1797,7 @@ int test_main()
test1.set_bit(1);
test1.set_bit(9);
TEST_CHECK(test1.count() == 3);
TEST_CHECK(test1.all_set() == false);
test1.clear_bit(2);
TEST_CHECK(test1.count() == 2);
int distance = std::distance(test1.begin(), test1.end());
@@ -1818,6 +1819,9 @@ int test_main()
test1.set_bit(1);
test1.resize(1);
TEST_CHECK(test1.count() == 1);
test1.resize(100, true);
TEST_CHECK(test1.all_set() == true);
return 0;
}