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 // <locale> 11 12 // template<class Codecvt, class Elem = wchar_t, 13 // class Wide_alloc = allocator<Elem>, 14 // class Byte_alloc = allocator<char>> 15 // class wstring_convert 16 // { 17 // public: 18 // typedef basic_string<char, char_traits<char>, Byte_alloc> byte_string; 19 // typedef basic_string<Elem, char_traits<Elem>, Wide_alloc> wide_string; 20 // typedef typename Codecvt::state_type state_type; 21 // typedef typename wide_string::traits_type::int_type int_type; 22 23 #include <locale> 24 #include <codecvt> 25 26 int main() 27 { 28 { 29 typedef std::wstring_convert<std::codecvt_utf8<wchar_t> > myconv; 30 static_assert((std::is_same<myconv::byte_string, std::string>::value), ""); 31 static_assert((std::is_same<myconv::wide_string, std::wstring>::value), ""); 32 static_assert((std::is_same<myconv::state_type, std::mbstate_t>::value), ""); 33 static_assert((std::is_same<myconv::int_type, std::char_traits<wchar_t>::int_type>::value), ""); 34 } 35 } 36