#include <iostream>
#include <assert.h>
#include "bm64.h"
#include "bmundef.h"
using namespace std;
int main(void)
{
try
{
bm::bvector<> bv { 1, 2, 3, bm::id_max-1 }; bm::bvector<>::size_type count = bv.count();
cout << "BitCount = " << count << endl;
cout << "Max possible ID = " << bm::id_max-1 << endl;
bm::bvector<>::size_type first, last;
bool range_found = bv.find_range(first, last);
assert(range_found);
(void)range_found;
cout << "[" << first << ", " << last << "]" << endl;
bm::bvector<> bv_full;
bv_full.set();
auto full_count = bv_full.count();
cout << "Full vector bitcount = " << full_count << endl;
bv_full.set(bm::id_max - 1, false);
bv &= bv_full;
bm::bvector<>::enumerator en = bv.first();
for (; en.valid(); ++en)
{
bm::id64_t idx = *en;
cout << idx << ", ";
}
cout << endl;
}
catch(std::exception& ex)
{
std::cerr << ex.what() << std::endl;
return 1;
}
return 0;
}