Home | History | Annotate | Download | only in string.classes
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // <string>
     11 
     12 // Test for the existence of:
     13 
     14 // basic_string typedef names
     15 // typedef basic_string<char> string;
     16 // typedef basic_string<char16_t> u16string;
     17 // typedef basic_string<char32_t> u32string;
     18 // typedef basic_string<wchar_t> wstring;
     19 
     20 #include <string>
     21 #include <type_traits>
     22 
     23 int main()
     24 {
     25     static_assert((std::is_same<std::string, std::basic_string<char> >::value), "");
     26     static_assert((std::is_same<std::wstring, std::basic_string<wchar_t> >::value), "");
     27 #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
     28     static_assert((std::is_same<std::u16string, std::basic_string<char16_t> >::value), "");
     29     static_assert((std::is_same<std::u32string, std::basic_string<char32_t> >::value), "");
     30 #endif  // _LIBCPP_HAS_NO_UNICODE_CHARS
     31 }
     32