Example demonstrates using set operations AND, OR, XOR, etc.
- See also
- bvsetalgebra.cpp
#include <iostream>
static
{
do
{
cout << value;
if (value)
{
cout << ",";
}
else
{
break;
}
} while(1);
cout << endl;
}
{
try
{
bv3 = bv1 & bv2;
bv2 &= bv1;
bv3 = bv1 | bv2;
bv2 |= bv1;
bv3 = bv2 - bv1;
bv2 -= bv1;
bv3 = bv2 ^ bv1;
bv2 ^= bv1;
if (bv2 == bv3)
{
cerr << "Equivalent. Comparison result = "
<< bv2.compare(bv3) << endl;
}
else
{
cout << "Error." << endl;
return 1;
}
}
catch(std::exception& ex)
{
std::cerr << ex.what() << std::endl;
}
return 0;
}