Is a bit field any more efficient (computationally) than masking bits and extracting the data by hand?

后端 未结 7 1653
庸人自扰
庸人自扰 2021-02-08 10:16

I have a numerous small pieces of data that I want to be able to shove into one larger data type. Let\'s say that, hypothetically, this is a date and time. The obvious method is

7条回答
  •  名媛妹妹
    2021-02-08 10:50

    Only if your architecture explicitly has a set of instructions for bit-wise manipulation and access.

提交回复
热议问题