如何解决如何将stl :: dynamic数据存储到文件中?
我想将stl :: dynamic_bitset数据存储到文件中。
我尝试过这种方法,但出现了一些错误,这似乎是存储位错误。
struct HashedDescription {
// Hash code generated by the primary hashing function.
stl::dynamic_bitset hash_code;
// Each bucket_ids[x] = y means the descriptor belongs to bucket y in bucket
// group x.
std::vector<uint16_t> bucket_ids;
};
struct HashedDescriptions {
// The hash information.
std::vector<HashedDescription> hashed_desc;
using Bucket = std::vector<int>;
// buckets[bucket_group][bucket_id] = bucket (container of description ids).
std::vector<std::vector<Bucket>> buckets;
};
out.write((char*)&sHashedDescription.hash_code[0],sizeof(stl::dynamic_bitset));
in.read((char*)&sHashedDescription.hash_code[0],sizeof(stl::dynamic_bitset));
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。