Example for shifting - insertion of bits.
- See also
- bm::bvector::insert
-
bm::bvector::shift_right
#include <iostream>
{
if (first == last)
cout << "<EMPTY SET>";
else
for(;first != last; ++first)
cout << *first << ", ";
cout << endl;
}
{
try
{
cout << "Source set:";
bv.shift_right();
bv.insert(0, false);
bv.insert(4, true);
}
catch(std::exception& ex)
{
std::cerr << ex.what() << std::endl;
return 1;
}
return 0;
}