问题描述
bit-vector和bitl容器的区别是什么?请解释。
我的理解bitset是bitvector的概念的实现我是对还是错?实现位向量的其他方法是什么?
What is the difference between bit-vector and bitset container of stl ? Please explain.To my understanding bitset is the implementation of the concept of bitvector am I right or wrong? What are the other ways to implement bit vector?
推荐答案
bit_vector
与 std :: vector
相同的接口,并针对空间进行了优化。它不是标准C ++的一部分。此声称它接近于STL 向量< bool>
,这可能是非常接近标准的C ++ std :: vector< bool>
。
bit_vector
has the same interface as an std::vector
, and is optimised for space. It not a part of standard C++. This documentation claims it is close to an STL vector<bool>
, which presumably is quite close to a standard C++ std::vector<bool>
.
的大小固定,并且具有不同的界面。
std::bitset is fixed size, and has a different interface.
这篇关于位矢量和bitset的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!