1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: no-localization
13 // template <class charT, class traits, size_t N>
14 // basic_istream<charT, traits>&
15 // operator>>(basic_istream<charT, traits>& is, bitset<N>& x);
20 #include "test_macros.h"
25 std::istringstream
in("01011010");
28 assert(b
.to_ulong() == 0x5A);
31 // Make sure that input-streaming an empty bitset does not cause the
32 // failbit to be set (LWG 3199).
33 std::istringstream
in("01011010");
36 assert(b
.to_string() == "");
42 #ifndef TEST_HAS_NO_EXCEPTIONS
46 is
.exceptions(std::ios::failbit
);
52 } catch (std::ios::failure
const&) {
64 is
.exceptions(std::ios::eofbit
);
70 } catch (std::ios::failure
const&) {
79 #endif // TEST_HAS_NO_EXCEPTIONS