stream_out.pass.cpp 759 B

1234567891011121314151617181920212223242526272829
  1. //===----------------------------------------------------------------------===//
  2. //
  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
  6. //
  7. //===----------------------------------------------------------------------===//
  8. // test:
  9. // template <class charT, class traits, size_t N>
  10. // basic_ostream<charT, traits>&
  11. // operator<<(basic_ostream<charT, traits>& os, const bitset<N>& x);
  12. #include <bitset>
  13. #include <sstream>
  14. #include <cassert>
  15. #include "test_macros.h"
  16. int main(int, char**)
  17. {
  18. std::ostringstream os;
  19. std::bitset<8> b(0x5A);
  20. os << b;
  21. assert(os.str() == "01011010");
  22. return 0;
  23. }