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