void feature_bitset_t::print(ostream& out) const
{
std::ios_base::fmtflags f(out.flags());
- out << "0x";
- for (int i = _vec.size() - 1; i >= 0; --i)
- out << std::setfill('0') << std::setw(sizeof(block_type) * 2)
- << std::hex << _vec[i];
+ int size = _vec.size();
+ if (!size) {
+ out << "0x0";
+ } else {
+ out << "0x";
+ for (int i = size - 1; i >= 0; --i)
+ out << std::setfill('0') << std::setw(sizeof(block_type) * 2)
+ << std::hex << _vec[i];
+ }
out.flags(f);
}