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: libcpp-has-no-localization
13 // template<class charT, class traits, class Allocator>
14 // basic_ostream<charT, traits>&
15 // operator<<(basic_ostream<charT, traits>& os,
16 // const basic_string_view<charT,traits> str);
18 #include <string_view>
22 #include "test_macros.h"
24 using std::string_view
;
25 using std::wstring_view
;
30 std::ostringstream out
;
31 string_view
sv("some text");
34 assert(sv
== out
.str());
37 std::ostringstream out
;
38 std::string
s("some text");
43 assert(" " + s
== out
.str());
46 std::wostringstream out
;
47 wstring_view
sv(L
"some text");
50 assert(sv
== out
.str());
53 std::wostringstream out
;
54 std::wstring
s(L
"some text");
59 assert(L
" " + s
== out
.str());