void test_BitString() { try { BitString x(30); BitString y(30); x.Set(3); x.Set(7); x.Set(14); y.Set(3); y.Set(5); y.Set(12); // Test out of bounds bit number handling // y.Set(32); std::cout << "X = " << x << std::endl; std::cout << "Y = " << y << std::endl; // Test bit-wise AND // BitString z = x & y; // std::cout << "X & Y = " << z << std::endl; // Test bit-wise OR // BitString z = x | y; // std::cout << "X | Y = " << z << std::endl; // Test bit-wise XOR BitString z = x^y; std::cout << "X ^ Y = " << z << std::endl; // Test bit-wise Count size_t c = z.Count(); std::cout << "Count X | Y = " << (int) c << std::endl; } // Catch any simple string error messages catch( char* s ) { std::cout << s << std::endl; } }