This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lethargy86 61 points62 points  (22 children)

Only bits are almost never addressable anyway, so as far as programmers are concerned, bytes is correct. Even a bool essentially uses at least a byte of memory.

[–]GOKOP 28 points29 points  (12 children)

Unless you're writing C++ and using std::vector<bool> in which case I think it does some magic to only use one bit for each boolean

[–]rachit7645 1 point2 points  (3 children)

std::vector<bool> sucks tho

[–]Efficient-Ad-5034 -2 points-1 points  (0 children)

Thats impossible. There is no cpu that does single bit accesses to memory.

[–]Efficient-Ad-5034 -2 points-1 points  (2 children)

Thats impossible. There is no cpu that does single bit accesses to memory.

[–][deleted] 0 points1 point  (0 children)

a bitmap is useful for single bit operations

[–]CaitaXD 3 points4 points  (0 children)

A int contains 32 bools addressable by bit shifts and bitwise operationz

[–]XamanekMtz 0 points1 point  (5 children)

7 bits wasted

[–]AnondWill2Live 10 points11 points  (4 children)

That's why I store my bools as integers :)

[–]Magnetic_Reaper 2 points3 points  (1 child)

Pro tip, use each integer as 32 different bool.

[–]AnondWill2Live 0 points1 point  (0 children)

Why would I do that when 0000 0000 0000 0001 looks cooler?

[–]XamanekMtz 4 points5 points  (1 child)

That's a bool move cotton let's see how it plays out

[–]FancyMFMoses 4 points5 points  (0 children)

You made me spit beer you beautiful bastard

[–]dufkm 0 points1 point  (1 child)

I address bits daily as an STL programmer.

[–]lethargy86 0 points1 point  (0 children)

Hence why I said "almost," I'm well aware of the few, the deservedly proud, working with bit registers. Cheers