|
Operators
Syntax:
#include <boost/bit_logic/bit_io.hpp> basic_istream<CharT,TraitsT> & operator<< ( BitContainerT & bits, basic_istream<CharT,TraitsT> & is ) ; basic_ostream<CharT,TraitsT> & operator>> ( basic_ostream<CharT,TraitsT> & is, BitContainerT const & bits ) ; Stream operators are used for inputting and outputting data from a Bit Container. stringstream foo ; foo << "1000110" ; bit_vector<> bits ( 7 ) ; bits << foo ; cout << bits << endl ; foo.clear() ; foo << hex << "7f" ; bits >> foo ; cout << hex << bits << endl ; This code would produce this output: 1000110 7f ostream operator can throws no exceptions. istream operator can throw : Exceptions:
|