| 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_stringbuf |
| 13 | // : public basic_streambuf<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_stringbuf(const basic_stringbuf&) = delete; |
| 24 | // basic_stringbuf& operator=(const basic_stringbuf&) = delete; |
| 25 | // |
| 26 | // basic_stringbuf(basic_stringbuf&& rhs); |
| 27 | // basic_stringbuf& operator=(basic_stringbuf&& rhs); |
| 28 | |
| 29 | #include <sstream> |
| 30 | #include <type_traits> |
| 31 | |
| 32 | #include "test_macros.h" |
| 33 | |
| 34 | static_assert(std::is_base_of<std::basic_streambuf<char>, std::basic_stringbuf<char> >::value, "" ); |
| 35 | static_assert(std::is_same<std::basic_stringbuf<char>::char_type, char>::value, "" ); |
| 36 | static_assert(std::is_same<std::basic_stringbuf<char>::traits_type, std::char_traits<char> >::value, "" ); |
| 37 | static_assert(std::is_same<std::basic_stringbuf<char>::int_type, std::char_traits<char>::int_type>::value, "" ); |
| 38 | static_assert(std::is_same<std::basic_stringbuf<char>::pos_type, std::char_traits<char>::pos_type>::value, "" ); |
| 39 | static_assert(std::is_same<std::basic_stringbuf<char>::off_type, std::char_traits<char>::off_type>::value, "" ); |
| 40 | static_assert(std::is_same<std::basic_stringbuf<char>::allocator_type, std::allocator<char> >::value, "" ); |
| 41 | |
| 42 | #ifndef TEST_HAS_NO_WIDE_CHARACTERS |
| 43 | static_assert(std::is_base_of<std::basic_streambuf<wchar_t>, std::basic_stringbuf<wchar_t> >::value, "" ); |
| 44 | static_assert(std::is_same<std::basic_stringbuf<wchar_t>::char_type, wchar_t>::value, "" ); |
| 45 | static_assert(std::is_same<std::basic_stringbuf<wchar_t>::traits_type, std::char_traits<wchar_t> >::value, "" ); |
| 46 | static_assert(std::is_same<std::basic_stringbuf<wchar_t>::int_type, std::char_traits<wchar_t>::int_type>::value, "" ); |
| 47 | static_assert(std::is_same<std::basic_stringbuf<wchar_t>::pos_type, std::char_traits<wchar_t>::pos_type>::value, "" ); |
| 48 | static_assert(std::is_same<std::basic_stringbuf<wchar_t>::off_type, std::char_traits<wchar_t>::off_type>::value, "" ); |
| 49 | static_assert(std::is_same<std::basic_stringbuf<wchar_t>::allocator_type, std::allocator<wchar_t> >::value, "" ); |
| 50 | #endif |
| 51 | |
| 52 | // Copy properties |
| 53 | |
| 54 | static_assert(!std::is_copy_constructible<std::basic_stringbuf<char> >::value, "" ); |
| 55 | static_assert(!std::is_copy_assignable<std::basic_stringbuf<char> >::value, "" ); |
| 56 | |
| 57 | #ifndef TEST_HAS_NO_WIDE_CHARACTERS |
| 58 | static_assert(!std::is_copy_constructible<std::basic_stringbuf<wchar_t> >::value, "" ); |
| 59 | static_assert(!std::is_copy_assignable<std::basic_stringbuf<wchar_t> >::value, "" ); |
| 60 | #endif |
| 61 | |
| 62 | // Move properties |
| 63 | |
| 64 | static_assert(std::is_move_constructible<std::basic_stringbuf<char> >::value, "" ); |
| 65 | static_assert(std::is_move_assignable<std::basic_stringbuf<char> >::value, "" ); |
| 66 | |
| 67 | #ifndef TEST_HAS_NO_WIDE_CHARACTERS |
| 68 | static_assert(std::is_move_constructible<std::basic_stringbuf<wchar_t> >::value, "" ); |
| 69 | static_assert(std::is_move_assignable<std::basic_stringbuf<wchar_t> >::value, "" ); |
| 70 | #endif |
| 71 | |