#include <iostream>
#include "bm.h"
#include "bmundef.h"
using namespace std;
template<class T> void PrintContainer(T first, T last)
{
if (first == last)
cout << "<EMPTY SET>";
else
for(;first != last; ++first)
cout << *first << ", ";
cout << endl;
}
int main(void)
{
try
{
bm::bvector<> bv { 1, 10, 100 };
bv.optimize();
cout << "Source set:";
PrintContainer(bv.first(), bv.end());
bool carry_over = bv.shift_left();
cout << "CO=" << carry_over << endl;
PrintContainer(bv.first(), bv.end());
bv.erase(0);
PrintContainer(bv.first(), bv.end());
bv.optimize();
}
catch(std::exception& ex)
{
std::cerr << ex.what() << std::endl;
return 1;
}
return 0;
}