Bitstream type of class

P

PSN

hello everyone,
Can someone suggest me what would be the best way to build something
like a bitstream class that allows me to do all sorts of bit
operations, same as the bitstream and also whole other custom
operations.

Thanks for your time,

PSN
 
C

Chris Fairles

hello everyone,
Can someone suggest me what would be the best way to build something
like a bitstream class that allows me to do all sorts of bit
operations, same as the bitstream and also whole other custom
operations.

Thanks for your time,

PSN


There's the std::bitset<size_t NumberOfBits> although its not a
"stream" but more like a container (set of flags). It does however
have all sorts of overloads for operating on bits.

If its a "byte stream" your after, then std::streambuf could be used
(but be warned if want the bytestream to be portable, streambuf does
not care of things such as endianess).

HTH,
Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top