Exmaple demonstrates bitvector serialization/deserialization.For more information please visit: http://bmagic.sourceforge.net
- See also
- bm::serializer
-
bm::deserialize
#include <stdlib.h>
#include <iostream>
static
{
{
if (rand() % 2500)
{
}
}
}
static
{
cout <<
"Bits count:" << bv.
count() << endl;
}
static
{
cout <<
"Bits count:" << bv.
count() << endl;
cout << "Serialized size:" << len << endl << endl;
return buf;
}
{
unsigned char* buf1 = 0;
unsigned char* buf2 = 0;
try
{
{
buf2 = sbuf.data();
auto sz = sbuf.size();
cout << "BV2 Serialized size:" << sz << endl;
}
{
if (cmp != 0)
{
std::cerr << "Error: bug in serialization" << std::endl;
}
cout << "BV_C Serialized size:" << sbuf2.size() << endl;
}
}
catch(std::exception& ex)
{
std::cerr << ex.what() << std::endl;
delete [] buf1;
return 1;
}
delete [] buf1;
return 0;
}