30 Jun
2013
30 Jun
'13
1:45 p.m.
On 30/06/13 05:09, Paul Long wrote:
On 6/29/2013 12:40 PM, Mathias Gaunard wrote:
What should I do if I want to define the operators on my own user-defined type?
Write them. It should be easy. For example, this is all it takes for ibitstream to support std::bitset:
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!?