开发者

What consumes more storage space - boost::dynamic_bitset<> or raw storage?

I have a program storage optimization question.

I have, let say 4096 "knots" stored in a:

  boost::dynamic_bitset<>

I am now considering refactoring my program and build a CKnot class which will contain a bool.

The question is what will consume more space:

Thanks


The bitset will be considerably smaller, as a bool in C++ must be at least a byte in size, whereas each bit in a bitset is exactly that, a bit.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜