bitwise operations on vector

前端 未结 4 1607
日久生厌
日久生厌 2020-12-06 16:22

what\'s the best way to perform bitwise operations on vector?

as i understand, vector is a specialisation that uses

4条回答
  •  天涯浪人
    2020-12-06 16:59

    If the number of bits are fixed at compile time, you would be much better off using std::bitset

    If not, (i.e. number of bits varies at runtime), then you should see and can use boost::dynamic_bitset)

    In both of these, it is extremely easy to do all the bitwise operations.

提交回复
热议问题