#include <iostream>
#include <vector>
static
{
for (; en.
valid() && cnt < 10; ++en, ++cnt)
cout << *en << ", ";
if (cnt == 10)
cout << " ...";
cout <<
"(size = "<< bv.
size() <<
")" << endl;
}
static
{
target_buf.resize(sbuf.size());
::memcpy(target_buf.data(), sbuf.buf(), sbuf.size());
}
static
{
{
}
{
bv_B.resize(10);
bv_A.bit_or(bv_B);
}
{
}
{
}
{
}
{
vector<size_type> vect_B { 1, 2, 4 };
}
{
vector<size_type> vect_B { 1, 2, 4 };
const size_type* arr = &vect_B[0];
}
{
vector<unsigned char> blob;
{
}
blob.data(),
tb,
}
{
}
}
static
{
{
}
{
bv_B.resize(10);
bv_A.bit_and(bv_B);
}
{
}
{
}
{
vector<unsigned> vect_B { 1, 2, 4 };
}
{
vector<size_type> vect_B { 1, 2, 4 };
const size_type* arr = &vect_B[0];
}
{
vector<unsigned char> blob;
{
}
blob.data(),
tb,
}
{
}
}
static
{
{
}
{
bv_B.resize(10);
bv_A.bit_xor(bv_B);
}
{
}
{
}
{
vector<unsigned> vect_B { 1, 2, 4 };
}
{
vector<unsigned char> blob;
{
}
blob.data(),
tb,
}
}
static
{
{
}
{
bv_B.resize(10);
bv_A.bit_sub(bv_B);
}
{
}
{
}
{
vector<size_type> vect_B { 1, 2, 4 };
}
{
vector<size_type> vect_B { 1, 2, 4 };
const size_type* arr = &vect_B[0];
}
{
vector<unsigned char> blob;
{
}
blob.data(),
tb,
}
{
}
}
static
{
{
}
{
bv_A.invert();
}
}
static
{
{
}
}
{
try
{
cout << endl << "Set Union (OR) demo" << endl << endl;
cout << endl << "Set Intersect (AND) demo" << endl << endl;
cout << endl << "XOR demo" << endl << endl;
cout << endl << "Set Minus (SUB/AND-NOT) demo" << endl << endl;
cout << endl << "Set Invert (NOT) demo" << endl << endl;
cout << endl << "Set AND-SUB demo" << endl << endl;
}
catch(std::exception& ex)
{
std::cerr << ex.what() << std::endl;
}
return 0;
}