Ok, I'm trying to create my own class I call bit_stream that handles i/o operations but through internal implementation can do i/o at the bit level. I'm essentially trying to find the best way to store the bits of an integer into a vector<bool> but I only need the bits that are significant, anything past the most significant bit is not needed.
The problem I keep running into is how to encode/write a character (or an int for that matter) to a binary file using only 7 bits rather than 8 bits. I've been directed by colleagues to use a bitset or vector<bool> for some of this but I still can't figure out the syntax or how exactly this works: