Example of how to use bm::str_sparse_vector<> - succinct container for bit-transposed string collections with NULL (unassigned) values support
- See also
- bm::str_sparse_vector
#include <iostream>
#include <string>
#include <vector>
using namespace std;
{
try
{
const char* s0 = "asz1234";
std::string str1 = "aqw1234";
std::string str3 = "54z";
std::string str00 = "00";
{
bi = "456";
bi = (const char*)0;
bi.flush();
}
std::cout <<
"sv size()=" << str_sv.
size() << endl;
{
if (str_sv[i].is_null())
cout << i << ":NULL" << endl;
else
{
const char* s = str_sv[i];
cout << i << ":" << s << endl;
}
}
cout << endl;
{
for (; it != it_end; ++it)
{
cout << "NULL" << endl;
else
cout << *it << endl;
}
}
}
catch(std::exception& ex)
{
std::cerr << ex.what() << std::endl;
return 1;
}
return 0;
}
str_sparse_vector< CharType, BV, MAX_STR_SIZE > & clear_range(size_type left, size_type right, bool set_null=false)
clear range (assign bit 0 for all plains)