tmp/tmpb_8dcnxv/{from.md → to.md}
RENAMED
|
@@ -14,18 +14,18 @@ specialization of the `basic_string` template (Clause [[strings]]).
|
|
| 14 |
*Effects:* The expression `in >> get_money(mon, intl)` described below
|
| 15 |
behaves as a formatted input function ([[istream.formatted.reqmts]]).
|
| 16 |
|
| 17 |
*Returns:* An object of unspecified type such that if `in` is an object
|
| 18 |
of type `basic_istream<charT, traits>` then the expression
|
| 19 |
-
`in >>
|
| 20 |
where the function `f` is defined as:
|
| 21 |
|
| 22 |
``` cpp
|
| 23 |
template <class charT, class traits, class moneyT>
|
| 24 |
void f(basic_ios<charT, traits>& str, moneyT& mon, bool intl) {
|
| 25 |
-
|
| 26 |
-
|
| 27 |
|
| 28 |
ios_base::iostate err = ios_base::goodbit;
|
| 29 |
const MoneyGet& mg = use_facet<MoneyGet>(str.getloc());
|
| 30 |
|
| 31 |
mg.get(Iter(str.rdbuf()), Iter(), intl, str, err, mon);
|
|
@@ -33,11 +33,11 @@ void f(basic_ios<charT, traits>& str, moneyT& mon, bool intl) {
|
|
| 33 |
if (ios_base::goodbit != err)
|
| 34 |
str.setstate(err);
|
| 35 |
}
|
| 36 |
```
|
| 37 |
|
| 38 |
-
The expression `in >>
|
| 39 |
`basic_istream<charT, traits>&` and value `in`.
|
| 40 |
|
| 41 |
``` cpp
|
| 42 |
template <class moneyT> unspecified put_money(const moneyT& mon, bool intl = false);
|
| 43 |
```
|
|
@@ -45,62 +45,63 @@ template <class moneyT> unspecified put_money(const moneyT& mon, bool intl = fal
|
|
| 45 |
*Requires:* The type `moneyT` shall be either `long double` or a
|
| 46 |
specialization of the `basic_string` template (Clause [[strings]]).
|
| 47 |
|
| 48 |
*Returns:* An object of unspecified type such that if `out` is an object
|
| 49 |
of type `basic_ostream<charT, traits>` then the expression
|
| 50 |
-
`out <<
|
| 51 |
-
calls `f(out, mon, intl)`,
|
|
|
|
| 52 |
|
| 53 |
``` cpp
|
| 54 |
template <class charT, class traits, class moneyT>
|
| 55 |
void f(basic_ios<charT, traits>& str, const moneyT& mon, bool intl) {
|
| 56 |
-
|
| 57 |
-
|
| 58 |
|
| 59 |
const MoneyPut& mp = use_facet<MoneyPut>(str.getloc());
|
| 60 |
const Iter end = mp.put(Iter(str.rdbuf()), intl, str, str.fill(), mon);
|
| 61 |
|
| 62 |
if (end.failed())
|
| 63 |
str.setstate(ios::badbit);
|
| 64 |
}
|
| 65 |
```
|
| 66 |
|
| 67 |
-
The expression `out <<
|
| 68 |
`basic_ostream<charT, traits>&` and value `out`.
|
| 69 |
|
| 70 |
``` cpp
|
| 71 |
template <class charT> unspecified get_time(struct tm* tmb, const charT* fmt);
|
| 72 |
```
|
| 73 |
|
| 74 |
*Requires:* The argument `tmb` shall be a valid pointer to an object of
|
| 75 |
-
type `struct tm`
|
| 76 |
array of objects of type `charT` with `char_traits<charT>::length(fmt)`
|
| 77 |
elements.
|
| 78 |
|
| 79 |
*Returns:* An object of unspecified type such that if `in` is an object
|
| 80 |
of type `basic_istream<charT, traits>` then the expression
|
| 81 |
-
`in >>
|
| 82 |
where the function `f` is defined as:
|
| 83 |
|
| 84 |
``` cpp
|
| 85 |
template <class charT, class traits>
|
| 86 |
void f(basic_ios<charT, traits>& str, struct tm* tmb, const charT* fmt) {
|
| 87 |
-
|
| 88 |
-
|
| 89 |
|
| 90 |
ios_base::iostate err = ios_base::goodbit;
|
| 91 |
const TimeGet& tg = use_facet<TimeGet>(str.getloc());
|
| 92 |
|
| 93 |
tg.get(Iter(str.rdbuf()), Iter(), str, err, tmb,
|
| 94 |
fmt, fmt + traits::length(fmt));
|
| 95 |
|
| 96 |
if (err != ios_base::goodbit)
|
| 97 |
-
str.setstate(err)
|
| 98 |
}
|
| 99 |
```
|
| 100 |
|
| 101 |
-
The expression `in >>
|
| 102 |
`basic_istream<charT, traits>&` and value `in`.
|
| 103 |
|
| 104 |
``` cpp
|
| 105 |
template <class charT> unspecified put_time(const struct tm* tmb, const charT* fmt);
|
| 106 |
```
|
|
@@ -110,26 +111,26 @@ type `struct tm`, and the argument `fmt` shall be a valid pointer to an
|
|
| 110 |
array of objects of type `charT` with `char_traits<charT>::length(fmt)`
|
| 111 |
elements.
|
| 112 |
|
| 113 |
*Returns:* An object of unspecified type such that if `out` is an object
|
| 114 |
of type `basic_ostream<charT, traits>` then the expression
|
| 115 |
-
`out <<
|
| 116 |
where the function `f` is defined as:
|
| 117 |
|
| 118 |
``` cpp
|
| 119 |
template <class charT, class traits>
|
| 120 |
void f(basic_ios<charT, traits>& str, const struct tm* tmb, const charT* fmt) {
|
| 121 |
-
|
| 122 |
-
|
| 123 |
|
| 124 |
const TimePut& tp = use_facet<TimePut>(str.getloc());
|
| 125 |
const Iter end = tp.put(Iter(str.rdbuf()), str, str.fill(), tmb,
|
| 126 |
fmt, fmt + traits::length(fmt));
|
| 127 |
|
| 128 |
if (end.failed())
|
| 129 |
str.setstate(ios_base::badbit);
|
| 130 |
}
|
| 131 |
```
|
| 132 |
|
| 133 |
-
The expression `out <<
|
| 134 |
`basic_ostream<charT, traits>&` and value `out`.
|
| 135 |
|
|
|
|
| 14 |
*Effects:* The expression `in >> get_money(mon, intl)` described below
|
| 15 |
behaves as a formatted input function ([[istream.formatted.reqmts]]).
|
| 16 |
|
| 17 |
*Returns:* An object of unspecified type such that if `in` is an object
|
| 18 |
of type `basic_istream<charT, traits>` then the expression
|
| 19 |
+
`in >> get_money(mon, intl)` behaves as if it called `f(in, mon, intl)`,
|
| 20 |
where the function `f` is defined as:
|
| 21 |
|
| 22 |
``` cpp
|
| 23 |
template <class charT, class traits, class moneyT>
|
| 24 |
void f(basic_ios<charT, traits>& str, moneyT& mon, bool intl) {
|
| 25 |
+
using Iter = istreambuf_iterator<charT, traits>;
|
| 26 |
+
using MoneyGet = money_get<charT, Iter>;
|
| 27 |
|
| 28 |
ios_base::iostate err = ios_base::goodbit;
|
| 29 |
const MoneyGet& mg = use_facet<MoneyGet>(str.getloc());
|
| 30 |
|
| 31 |
mg.get(Iter(str.rdbuf()), Iter(), intl, str, err, mon);
|
|
|
|
| 33 |
if (ios_base::goodbit != err)
|
| 34 |
str.setstate(err);
|
| 35 |
}
|
| 36 |
```
|
| 37 |
|
| 38 |
+
The expression `in >> get_money(mon, intl)` shall have type
|
| 39 |
`basic_istream<charT, traits>&` and value `in`.
|
| 40 |
|
| 41 |
``` cpp
|
| 42 |
template <class moneyT> unspecified put_money(const moneyT& mon, bool intl = false);
|
| 43 |
```
|
|
|
|
| 45 |
*Requires:* The type `moneyT` shall be either `long double` or a
|
| 46 |
specialization of the `basic_string` template (Clause [[strings]]).
|
| 47 |
|
| 48 |
*Returns:* An object of unspecified type such that if `out` is an object
|
| 49 |
of type `basic_ostream<charT, traits>` then the expression
|
| 50 |
+
`out << put_money(mon, intl)` behaves as a formatted output
|
| 51 |
+
function ([[ostream.formatted.reqmts]]) that calls `f(out, mon, intl)`,
|
| 52 |
+
where the function `f` is defined as:
|
| 53 |
|
| 54 |
``` cpp
|
| 55 |
template <class charT, class traits, class moneyT>
|
| 56 |
void f(basic_ios<charT, traits>& str, const moneyT& mon, bool intl) {
|
| 57 |
+
using Iter = ostreambuf_iterator<charT, traits>;
|
| 58 |
+
using MoneyPut = money_put<charT, Iter>;
|
| 59 |
|
| 60 |
const MoneyPut& mp = use_facet<MoneyPut>(str.getloc());
|
| 61 |
const Iter end = mp.put(Iter(str.rdbuf()), intl, str, str.fill(), mon);
|
| 62 |
|
| 63 |
if (end.failed())
|
| 64 |
str.setstate(ios::badbit);
|
| 65 |
}
|
| 66 |
```
|
| 67 |
|
| 68 |
+
The expression `out << put_money(mon, intl)` shall have type
|
| 69 |
`basic_ostream<charT, traits>&` and value `out`.
|
| 70 |
|
| 71 |
``` cpp
|
| 72 |
template <class charT> unspecified get_time(struct tm* tmb, const charT* fmt);
|
| 73 |
```
|
| 74 |
|
| 75 |
*Requires:* The argument `tmb` shall be a valid pointer to an object of
|
| 76 |
+
type `struct tm`. The argument `fmt` shall be a valid pointer to an
|
| 77 |
array of objects of type `charT` with `char_traits<charT>::length(fmt)`
|
| 78 |
elements.
|
| 79 |
|
| 80 |
*Returns:* An object of unspecified type such that if `in` is an object
|
| 81 |
of type `basic_istream<charT, traits>` then the expression
|
| 82 |
+
`in >> get_time(tmb, fmt)` behaves as if it called `f(in, tmb, fmt)`,
|
| 83 |
where the function `f` is defined as:
|
| 84 |
|
| 85 |
``` cpp
|
| 86 |
template <class charT, class traits>
|
| 87 |
void f(basic_ios<charT, traits>& str, struct tm* tmb, const charT* fmt) {
|
| 88 |
+
using Iter = istreambuf_iterator<charT, traits>;
|
| 89 |
+
using TimeGet = time_get<charT, Iter>;
|
| 90 |
|
| 91 |
ios_base::iostate err = ios_base::goodbit;
|
| 92 |
const TimeGet& tg = use_facet<TimeGet>(str.getloc());
|
| 93 |
|
| 94 |
tg.get(Iter(str.rdbuf()), Iter(), str, err, tmb,
|
| 95 |
fmt, fmt + traits::length(fmt));
|
| 96 |
|
| 97 |
if (err != ios_base::goodbit)
|
| 98 |
+
str.setstate(err);
|
| 99 |
}
|
| 100 |
```
|
| 101 |
|
| 102 |
+
The expression `in >> get_time(tmb, fmt)` shall have type
|
| 103 |
`basic_istream<charT, traits>&` and value `in`.
|
| 104 |
|
| 105 |
``` cpp
|
| 106 |
template <class charT> unspecified put_time(const struct tm* tmb, const charT* fmt);
|
| 107 |
```
|
|
|
|
| 111 |
array of objects of type `charT` with `char_traits<charT>::length(fmt)`
|
| 112 |
elements.
|
| 113 |
|
| 114 |
*Returns:* An object of unspecified type such that if `out` is an object
|
| 115 |
of type `basic_ostream<charT, traits>` then the expression
|
| 116 |
+
`out << put_time(tmb, fmt)` behaves as if it called `f(out, tmb, fmt)`,
|
| 117 |
where the function `f` is defined as:
|
| 118 |
|
| 119 |
``` cpp
|
| 120 |
template <class charT, class traits>
|
| 121 |
void f(basic_ios<charT, traits>& str, const struct tm* tmb, const charT* fmt) {
|
| 122 |
+
using Iter = ostreambuf_iterator<charT, traits>;
|
| 123 |
+
using TimePut = time_put<charT, Iter>;
|
| 124 |
|
| 125 |
const TimePut& tp = use_facet<TimePut>(str.getloc());
|
| 126 |
const Iter end = tp.put(Iter(str.rdbuf()), str, str.fill(), tmb,
|
| 127 |
fmt, fmt + traits::length(fmt));
|
| 128 |
|
| 129 |
if (end.failed())
|
| 130 |
str.setstate(ios_base::badbit);
|
| 131 |
}
|
| 132 |
```
|
| 133 |
|
| 134 |
+
The expression `out << put_time(tmb, fmt)` shall have type
|
| 135 |
`basic_ostream<charT, traits>&` and value `out`.
|
| 136 |
|