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
9// <sstream>
10
11// template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
12// class basic_stringstream
13// : public basic_iostream<charT, traits>
14// {
15// public:
16// typedef charT char_type;
17// typedef traits traits_type;
18// typedef typename traits_type::int_type int_type;
19// typedef typename traits_type::pos_type pos_type;
20// typedef typename traits_type::off_type off_type;
21// typedef Allocator allocator_type;
22//
23// basic_stringstream(const basic_stringstream&) = delete;
24// basic_stringstream& operator=(const basic_stringstream&) = delete;
25//
26// basic_stringstream(basic_stringstream&& rhs);
27// basic_stringstream& operator=(basic_stringstream&& rhs);
28
29#include <sstream>
30#include <type_traits>
31
32#include "test_macros.h"
33
34// Types
35
36static_assert(std::is_base_of<std::basic_iostream<char>, std::basic_stringstream<char> >::value, "");
37static_assert(std::is_same<std::basic_stringstream<char>::char_type, char>::value, "");
38static_assert(std::is_same<std::basic_stringstream<char>::traits_type, std::char_traits<char> >::value, "");
39static_assert(std::is_same<std::basic_stringstream<char>::int_type, std::char_traits<char>::int_type>::value, "");
40static_assert(std::is_same<std::basic_stringstream<char>::pos_type, std::char_traits<char>::pos_type>::value, "");
41static_assert(std::is_same<std::basic_stringstream<char>::off_type, std::char_traits<char>::off_type>::value, "");
42static_assert(std::is_same<std::basic_stringstream<char>::allocator_type, std::allocator<char> >::value, "");
43
44#ifndef TEST_HAS_NO_WIDE_CHARACTERS
45static_assert(std::is_base_of<std::basic_iostream<wchar_t>, std::basic_stringstream<wchar_t> >::value, "");
46static_assert(std::is_same<std::basic_stringstream<wchar_t>::char_type, wchar_t>::value, "");
47static_assert(std::is_same<std::basic_stringstream<wchar_t>::traits_type, std::char_traits<wchar_t> >::value, "");
48static_assert(std::is_same<std::basic_stringstream<wchar_t>::int_type, std::char_traits<wchar_t>::int_type>::value, "");
49static_assert(std::is_same<std::basic_stringstream<wchar_t>::pos_type, std::char_traits<wchar_t>::pos_type>::value, "");
50static_assert(std::is_same<std::basic_stringstream<wchar_t>::off_type, std::char_traits<wchar_t>::off_type>::value, "");
51static_assert(std::is_same<std::basic_stringstream<wchar_t>::allocator_type, std::allocator<wchar_t> >::value, "");
52#endif
53
54// Copy properties
55
56static_assert(!std::is_copy_constructible<std::stringstream>::value, "");
57static_assert(!std::is_copy_assignable<std::stringstream>::value, "");
58
59#ifndef TEST_HAS_NO_WIDE_CHARACTERS
60static_assert(!std::is_copy_constructible<std::wstringstream>::value, "");
61static_assert(!std::is_copy_assignable<std::wstringstream>::value, "");
62#endif
63
64// Move properties
65
66static_assert(std::is_move_constructible<std::stringstream>::value, "");
67static_assert(std::is_move_assignable<std::stringstream>::value, "");
68
69#ifndef TEST_HAS_NO_WIDE_CHARACTERS
70static_assert(std::is_move_constructible<std::wstringstream>::value, "");
71static_assert(std::is_move_assignable<std::wstringstream>::value, "");
72#endif
73

source code of libcxx/test/std/input.output/string.streams/stringstream/types.compile.pass.cpp