types.pass.cpp revision b64f8b07c104c6cc986570ac8ee0ed16a9f23976
1c37f4a04ef89e73a39a59f3c5a179af8c8ab5974Brian Carlstrom//===----------------------------------------------------------------------===// 2c37f4a04ef89e73a39a59f3c5a179af8c8ab5974Brian Carlstrom// 3c37f4a04ef89e73a39a59f3c5a179af8c8ab5974Brian Carlstrom// The LLVM Compiler Infrastructure 4c37f4a04ef89e73a39a59f3c5a179af8c8ab5974Brian Carlstrom// 5c37f4a04ef89e73a39a59f3c5a179af8c8ab5974Brian Carlstrom// This file is dual licensed under the MIT and the University of Illinois Open 6c37f4a04ef89e73a39a59f3c5a179af8c8ab5974Brian Carlstrom// Source Licenses. See LICENSE.TXT for details. 7c37f4a04ef89e73a39a59f3c5a179af8c8ab5974Brian Carlstrom// 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 26int 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