stream_in.pass.cpp revision f5256e16dfc425c1d466f6308d4026d529ce9e0b
1//===----------------------------------------------------------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. 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 20int main() 21{ 22 std::istringstream in("01011010"); 23 std::bitset<8> b; 24 in >> b; 25 assert(b.to_ulong() == 0x5A); 26} 27