1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // template<class charT, class traits, class Allocator>
13 // basic_ostream<charT, traits>&
14 // operator<<(basic_ostream<charT, traits>& os,
15 // const basic_string_view<charT,traits> str);
17 #include <experimental/string_view>
21 using std::experimental::string_view;
22 using std::experimental::wstring_view;
27 std::ostringstream out;
28 string_view sv("some text");
31 assert(sv == out.str());
34 std::ostringstream out;
35 std::string s("some text");
40 assert(" " + s == out.str());
43 std::wostringstream out;
44 wstring_view sv(L"some text");
47 assert(sv == out.str());
50 std::wostringstream out;
51 std::wstring s(L"some text");
56 assert(L" " + s == out.str());