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// <regex>
10
11// template <class charT>
12// struct regex_traits
13// {
14// public:
15// typedef charT char_type;
16// typedef basic_string<char_type> string_type;
17// typedef locale locale_type;
18
19#include <regex>
20#include <type_traits>
21#include "test_macros.h"
22
23int main(int, char**)
24{
25 static_assert((std::is_same<std::regex_traits<char>::char_type, char>::value), "");
26 static_assert((std::is_same<std::regex_traits<char>::string_type, std::string>::value), "");
27 static_assert((std::is_same<std::regex_traits<char>::locale_type, std::locale>::value), "");
28#ifndef TEST_HAS_NO_WIDE_CHARACTERS
29 static_assert((std::is_same<std::regex_traits<wchar_t>::char_type, wchar_t>::value), "");
30 static_assert((std::is_same<std::regex_traits<wchar_t>::string_type, std::wstring>::value), "");
31 static_assert((std::is_same<std::regex_traits<wchar_t>::locale_type, std::locale>::value), "");
32#endif
33
34 return 0;
35}
36

source code of libcxx/test/std/re/re.traits/types.pass.cpp