brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · d57acf2 Raw
42 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// UNSUPPORTED: c++03, c++11, c++14, c++1710// UNSUPPORTED: no-localization11// UNSUPPORTED: libcpp-has-no-experimental-syncstream12 13// <syncstream>14 15// template <class charT, class traits, class Allocator>16// class basic_osyncstream;17 18// streambuf_type* get_wrapped() const noexcept;19 20#include <syncstream>21#include <sstream>22#include <cassert>23 24#include "test_macros.h"25 26template <class CharT>27void test() {28  std::basic_stringbuf<CharT> base;29  const std::basic_osyncstream<CharT> out{&base};30  assert(out.get_wrapped() == &base);31  ASSERT_NOEXCEPT(out.get_wrapped());32}33 34int main(int, char**) {35  test<char>();36#ifndef TEST_HAS_NO_WIDE_CHARACTERS37  test<wchar_t>();38#endif39 40  return 0;41}42