decimal_point.pass.cpp revision f5256e16dfc425c1d466f6308d4026d529ce9e0b
1//===----------------------------------------------------------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10// <locale> 11 12// class moneypunct<charT, International> 13 14// charT decimal_point() const; 15 16// The C++ and C standards are silent. 17// POSIX standard is being followed (as a guideline). 18 19#include <locale> 20#include <limits> 21#include <cassert> 22 23typedef std::moneypunct<char> F; 24 25class Fnf 26 : public std::moneypunct<char, false> 27{ 28public: 29 explicit Fnf(std::size_t refs = 0) 30 : std::moneypunct<char, false>(refs) {} 31}; 32 33class Fnt 34 : public std::moneypunct<char, true> 35{ 36public: 37 explicit Fnt(std::size_t refs = 0) 38 : std::moneypunct<char, true>(refs) {} 39}; 40 41class Fwf 42 : public std::moneypunct<wchar_t, false> 43{ 44public: 45 explicit Fwf(std::size_t refs = 0) 46 : std::moneypunct<wchar_t, false>(refs) {} 47}; 48 49class Fwt 50 : public std::moneypunct<wchar_t, true> 51{ 52public: 53 explicit Fwt(std::size_t refs = 0) 54 : std::moneypunct<wchar_t, true>(refs) {} 55}; 56 57int main() 58{ 59 { 60 Fnf f(1); 61 assert(f.decimal_point() == std::numeric_limits<char>::max()); 62 } 63 { 64 Fnt f(1); 65 assert(f.decimal_point() == std::numeric_limits<char>::max()); 66 } 67 { 68 Fwf f(1); 69 assert(f.decimal_point() == std::numeric_limits<wchar_t>::max()); 70 } 71 { 72 Fwt f(1); 73 assert(f.decimal_point() == std::numeric_limits<wchar_t>::max()); 74 } 75} 76