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 // <locale> 10 11 // template <class charT> class numpunct; 12 13 // string_type truename() const; 14 15 #include <locale> 16 #include <cassert> 17 18 #include "test_macros.h" 19 main(int,char **)20int main(int, char**) 21 { 22 std::locale l = std::locale::classic(); 23 { 24 typedef char C; 25 const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l); 26 assert(np.truename() == std::string("true")); 27 } 28 #ifndef TEST_HAS_NO_WIDE_CHARACTERS 29 { 30 typedef wchar_t C; 31 const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l); 32 assert(np.truename() == std::wstring(L"true")); 33 } 34 #endif 35 36 return 0; 37 } 38