UInt8 access Bits?

And somehow I missed that part initially.

  1. Bit shift is not complicated, in fact it’s much simpler than accessing memory.
  2. There’s no memory to access here, different bits do not have different memory location.

Now if you are talking about syntax only and if you just want to have a shorter syntax to write, and what you mean by accessing memory is the [] syntax then sure, you can implement it yourself. And I won’t even bother implementing the [] syntax but just a function like setbit, testbit would work, very similar to what I did here. In any case, bit shifting is what you must do (even for the digits version, you just do much more useless stuff at the same time) but you can hide that behind whatever syntax you like…

2 Likes