Example of how to serialize bm::sparse_vector<> template class
- See also
- bm::sparse_vector<>
-
bm::sparse_vector<>::push_back
-
bm::sparse_vector<>::equal
-
bm::sparse_vector_serialize
-
bm::sparse_vector_deserialize
#include <iostream>
#include <vector>
{
try
{
for (unsigned i = 0; i < 128000; ++i)
{
}
const unsigned char* buf = sv_lay.
buf();
size_t buf_size = sv_lay.
size();
vector<unsigned char> tmp_buf(buf_size);
::memcpy(&tmp_buf[0], buf, buf_size);
if (res != 0)
{
cerr << "De-Serialization error!" << endl;
return 1;
}
{
cerr << "Error! Please report a bug to BitMagic project support." << endl;
return 1;
}
cout << sv2.
size() << endl;
}
catch(std::exception& ex)
{
std::cerr << ex.what() << std::endl;
return 1;
}
return 0;
}