I wish to have a list of bits where I can perform maths operations on a section of the list, for example.
value: 864
as bits, pos: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
as bits, value: 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0
If I take bits 1 to 4 and 6 to 9 I get 0, 1, 1, 0, 1, 0, 0, 0 (104). Then if I add 3 it becomes 0, 1, 1, 0, 1, 0, 1, 1 (107).
I could do this with a std::vector and a process of involving bitwise operations between the bits, with code that looks like this sort of thing if(xor(data[n], data[n2])) {data[n - 1] == false;} etc...
I could even use POD arrays but I was thinking, C++ being so close to the internals of the computer is often not helpfull, but here it is, it could allow this operation to be done extremely quickly.
Something like storing the values in a big POD variable or an array and then copying them into the memory of another variable such that the mathmatical operations could be done before copying them back into the position in there storage again?
Even better could the for example addition operator somehow take that position in memory as a parameter to perform the addition directly into the middle of the store of data?