30 Jun
2013
30 Jun
'13
4:38 p.m.
On 6/30/2013 8:45 AM, Mathias Gaunard wrote:
On 30/06/13 05:09, Paul Long wrote:
template
ibitstream &operator>>(ibitstream &ibs, std::bitset<N> &bs) { decltype(bs.to_ulong()) value; ibs.read(value, N); That is surprising. istream's read takes a char* and a size in bytes.
ibitstream's read takes a unsigned long& and a size in bits!?
The entire class hierarchy to which istream belongs processes sequences of _characters_--it should really be called icharstream--so of course it takes a size in bytes. The proposed bitstream library processes unaligned sequences of bits, so it takes a size in bits. What's surprising? Paul