代码之家  ›  专栏  ›  技术社区  ›  Antonin GAVREL

是否可以使用位数组而不是字节数组[[副本]

  •  0
  • Antonin GAVREL  · 技术社区  · 5 年前

    我需要一个功能等于 vector<bool> 在C++中。 The Rust documentation tells about BitVec ,但是 use std::collections::BitVec 原因 a pull request , 比特向量

    0 回复  |  直到 9 年前
        1
  •  22
  •   Lukas Kalbertodt    8 年前

    标准库中不存在专用位向量,并且 Vec<bool> 不像C++那样专业化 vector<bool> . Rust提倡使用外部板条箱,而不是建立一个巨大的标准库。这个用例的实际板条箱是 bit-vec .

    您似乎找到了指向旧标准库文档的链接: https://doc.rust-lang.org/1.2.0/std/collections/struct.BitVec.html 1.2.0 在url中!Rust的当前版本是1.25(截至2018年4月),这意味着 1.2 BitVec

    推荐文章