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 //===----------------------------------------------------------------------===//
11 // template<class charT, class traits, class Allocator>
12 // basic_ostream<charT, traits>&
13 // operator<<(basic_ostream<charT, traits>& os,
14 // const basic_string<charT,traits,Allocator>& str);
20 #include "test_macros.h"
21 #include "min_allocator.h"
23 template <template <class> class Alloc
>
25 using S
= std::basic_string
<char, std::char_traits
<char>, Alloc
<char> >;
26 using OS
= std::basic_ostringstream
<char, std::char_traits
<char>, Alloc
<char> >;
32 assert(s
== out
.str());
40 assert(" " + s
== out
.str());
42 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
43 using WS
= std::basic_string
<wchar_t, std::char_traits
<wchar_t>, Alloc
<wchar_t> >;
44 using WOS
= std::basic_ostringstream
<wchar_t, std::char_traits
<wchar_t>, Alloc
<wchar_t> >;
50 assert(s
== out
.str());
58 assert(L
" " + s
== out
.str());
63 int main(int, char**) {
64 test
<std::allocator
>();
66 #if TEST_STD_VER >= 11
67 test
<min_allocator
>();