blob: 5773224258678ddb4c15b12b9364be9b60a53cb9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// <locale>
// class moneypunct<charT, International>
// string_type curr_symbol() const;
// The C++ and C standards are silent.
// POSIX standard is being followed (as a guideline).
#include <locale>
#include <limits>
#include <cassert>
typedef std::moneypunct<char> F;
class Fnf
: public std::moneypunct<char, false>
{
public:
explicit Fnf(std::size_t refs = 0)
: std::moneypunct<char, false>(refs) {}
};
class Fnt
: public std::moneypunct<char, true>
{
public:
explicit Fnt(std::size_t refs = 0)
: std::moneypunct<char, true>(refs) {}
};
class Fwf
: public std::moneypunct<wchar_t, false>
{
public:
explicit Fwf(std::size_t refs = 0)
: std::moneypunct<wchar_t, false>(refs) {}
};
class Fwt
: public std::moneypunct<wchar_t, true>
{
public:
explicit Fwt(std::size_t refs = 0)
: std::moneypunct<wchar_t, true>(refs) {}
};
int main()
{
{
Fnf f(1);
assert(f.curr_symbol() == std::string());
}
{
Fnt f(1);
assert(f.curr_symbol() == std::string());
}
{
Fwf f(1);
assert(f.curr_symbol() == std::wstring());
}
{
Fwt f(1);
assert(f.curr_symbol() == std::wstring());
}
}
|