thousands_sep.pass.cpp revision e2f2a15066552758a508e8a7325e0ccad4a5389b
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 charT> class numpunct_byname; 13 14// char_type thousands_sep() const; 15 16#include <locale> 17#include <cassert> 18 19int main() 20{ 21 { 22 std::locale l("C"); 23 { 24 typedef char C; 25 const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l); 26 assert(np.thousands_sep() == ','); 27 } 28 { 29 typedef wchar_t C; 30 const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l); 31 assert(np.thousands_sep() == L','); 32 } 33 } 34 { 35 std::locale l("en_US.UTF-8"); 36 { 37 typedef char C; 38 const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l); 39 assert(np.thousands_sep() == ','); 40 } 41 { 42 typedef wchar_t C; 43 const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l); 44 assert(np.thousands_sep() == L','); 45 } 46 } 47 { 48 std::locale l("fr_FR.UTF-8"); 49 { 50 typedef char C; 51 const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l); 52 assert(np.thousands_sep() == ','); 53 } 54 { 55 typedef wchar_t C; 56 const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l); 57 assert(np.thousands_sep() == L','); 58 } 59 } 60} 61