xref: /llvm-project/libcxx/test/std/re/re.traits/types.pass.cpp (revision f4c1258d5633fcf06385ff3fd1f4bf57ab971964)
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 
main(int,char **)23 int 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