1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // test: 11 12 // template <class charT, class traits, size_t N> 13 // basic_ostream<charT, traits>& 14 // operator<<(basic_ostream<charT, traits>& os, const bitset<N>& x); 15 16 #include <bitset> 17 #include <sstream> 18 #include <cassert> 19 20 int main() 21 { 22 std::istringstream in("01011010"); 23 std::bitset<8> b; 24 in >> b; 25 assert(b.to_ulong() == 0x5A); 26 } 27