#include <iostream>
#include <algorithm>
#include "bm.h"
#include "bmundef.h"
using namespace std;
inline
void Print(bm::bvector<>::size_type n)
{
cout << n << endl;;
}
int main(void)
{
try
{
bm::bvector<> bv;
bv[10] = true;
bv[100] = true;
bv[10000] = true;
bv[65536] = true;
bv[65537] = true;
bv[65538] = true;
bv[65540] = true;
bm::bvector<>::enumerator en = bv.first();
bm::bvector<>::enumerator en_end = bv.end();
while (en < en_end)
{
cout << *en << ", ";
++en; }
cout << endl;
en = bv.first();
std::for_each(en, en_end, Print);
cout << endl;
en.go_to(65537);
for (; en.valid(); ++en)
{
cout << *en << ", ";
}
cout << endl;
}
catch(std::exception& ex)
{
std::cerr << ex.what() << std::endl;
return 1;
}
return 0;
}