you are viewing a single comment's thread
view the rest of the comments
[–] 7 points 1 year ago*

It's called bitshifting and is used to select which bits you want to modify so you can toggle them individually.

1 << 0 is the flag for the first bit
1 << 1 for the second
1 << 2 for the third and so on

I think that's correct. It's been years since I've used this technique tbh 😅

  • source
  • parent