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// <streambuf>
10
11// template <class charT, class traits = char_traits<charT> >
12// class basic_streambuf
13// {
14// public:
15// // types:
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
22#include <streambuf>
23#include <type_traits>
24
25#include "test_macros.h"
26
27int main(int, char**)
28{
29 static_assert((std::is_same<std::streambuf::char_type, char>::value), "");
30 static_assert((std::is_same<std::streambuf::traits_type, std::char_traits<char> >::value), "");
31 static_assert((std::is_same<std::streambuf::int_type, std::char_traits<char>::int_type>::value), "");
32 static_assert((std::is_same<std::streambuf::pos_type, std::char_traits<char>::pos_type>::value), "");
33 static_assert((std::is_same<std::streambuf::off_type, std::char_traits<char>::off_type>::value), "");
34
35#ifndef TEST_HAS_NO_WIDE_CHARACTERS
36 static_assert((std::is_same<std::wstreambuf::char_type, wchar_t>::value), "");
37 static_assert((std::is_same<std::wstreambuf::traits_type, std::char_traits<wchar_t> >::value), "");
38 static_assert((std::is_same<std::wstreambuf::int_type, std::char_traits<wchar_t>::int_type>::value), "");
39 static_assert((std::is_same<std::wstreambuf::pos_type, std::char_traits<wchar_t>::pos_type>::value), "");
40 static_assert((std::is_same<std::wstreambuf::off_type, std::char_traits<wchar_t>::off_type>::value), "");
41#endif
42
43 return 0;
44}
45

source code of libcxx/test/std/input.output/stream.buffers/streambuf/types.pass.cpp