tmp/tmp6etdonsg/{from.md → to.md}
RENAMED
|
@@ -6,15 +6,15 @@ values for money and time.
|
|
| 6 |
|
| 7 |
``` cpp
|
| 8 |
template<class moneyT> unspecified get_money(moneyT& mon, bool intl = false);
|
| 9 |
```
|
| 10 |
|
| 11 |
-
*
|
| 12 |
-
specialization of the `basic_string` template
|
| 13 |
|
| 14 |
*Effects:* The expression `in >> get_money(mon, intl)` described below
|
| 15 |
-
behaves as a formatted input function
|
| 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:
|
|
@@ -33,24 +33,24 @@ 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 >> get_money(mon, intl)`
|
| 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 |
```
|
| 44 |
|
| 45 |
-
*
|
| 46 |
-
specialization of the `basic_string` template
|
| 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
|
| 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) {
|
|
@@ -59,25 +59,24 @@ void f(basic_ios<charT, traits>& str, const moneyT& mon, bool intl) {
|
|
| 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(
|
| 65 |
}
|
| 66 |
```
|
| 67 |
|
| 68 |
-
The expression `out << put_money(mon, intl)`
|
| 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 |
-
*
|
| 76 |
-
type `struct tm`
|
| 77 |
-
|
| 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:
|
|
@@ -97,21 +96,20 @@ void f(basic_ios<charT, traits>& str, struct tm* tmb, const charT* fmt) {
|
|
| 97 |
if (err != ios_base::goodbit)
|
| 98 |
str.setstate(err);
|
| 99 |
}
|
| 100 |
```
|
| 101 |
|
| 102 |
-
The expression `in >> get_time(tmb, fmt)`
|
| 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 |
```
|
| 108 |
|
| 109 |
-
*
|
| 110 |
-
type `struct tm`, and
|
| 111 |
-
|
| 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:
|
|
@@ -129,8 +127,8 @@ void f(basic_ios<charT, traits>& str, const struct tm* tmb, const charT* fmt) {
|
|
| 129 |
if (end.failed())
|
| 130 |
str.setstate(ios_base::badbit);
|
| 131 |
}
|
| 132 |
```
|
| 133 |
|
| 134 |
-
The expression `out << put_time(tmb, fmt)`
|
| 135 |
`basic_ostream<charT, traits>&` and value `out`.
|
| 136 |
|
|
|
|
| 6 |
|
| 7 |
``` cpp
|
| 8 |
template<class moneyT> unspecified get_money(moneyT& mon, bool intl = false);
|
| 9 |
```
|
| 10 |
|
| 11 |
+
*Mandates:* The type `moneyT` is either `long double` or a
|
| 12 |
+
specialization of the `basic_string` template [[strings]].
|
| 13 |
|
| 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:
|
|
|
|
| 33 |
if (ios_base::goodbit != err)
|
| 34 |
str.setstate(err);
|
| 35 |
}
|
| 36 |
```
|
| 37 |
|
| 38 |
+
The expression `in >> get_money(mon, intl)` has 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 |
```
|
| 44 |
|
| 45 |
+
*Mandates:* The type `moneyT` is either `long double` or a
|
| 46 |
+
specialization of the `basic_string` template [[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) {
|
|
|
|
| 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_base::badbit);
|
| 65 |
}
|
| 66 |
```
|
| 67 |
|
| 68 |
+
The expression `out << put_money(mon, intl)` has 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 |
+
*Preconditions:* The argument `tmb` is a valid pointer to an object of
|
| 76 |
+
type `struct tm`, and \[`fmt`, `fmt + char_traits<charT>::length(fmt)`)
|
| 77 |
+
is a valid range.
|
|
|
|
| 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 >> get_time(tmb, fmt)` behaves as if it called `f(in, tmb, fmt)`,
|
| 82 |
where the function `f` is defined as:
|
|
|
|
| 96 |
if (err != ios_base::goodbit)
|
| 97 |
str.setstate(err);
|
| 98 |
}
|
| 99 |
```
|
| 100 |
|
| 101 |
+
The expression `in >> get_time(tmb, fmt)` has type
|
| 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 |
```
|
| 107 |
|
| 108 |
+
*Preconditions:* The argument `tmb` is a valid pointer to an object of
|
| 109 |
+
type `struct tm`, and \[`fmt`, `fmt + char_traits<charT>::length(fmt)`)
|
| 110 |
+
is a valid range.
|
|
|
|
| 111 |
|
| 112 |
*Returns:* An object of unspecified type such that if `out` is an object
|
| 113 |
of type `basic_ostream<charT, traits>` then the expression
|
| 114 |
`out << put_time(tmb, fmt)` behaves as if it called `f(out, tmb, fmt)`,
|
| 115 |
where the function `f` is defined as:
|
|
|
|
| 127 |
if (end.failed())
|
| 128 |
str.setstate(ios_base::badbit);
|
| 129 |
}
|
| 130 |
```
|
| 131 |
|
| 132 |
+
The expression `out << put_time(tmb, fmt)` has type
|
| 133 |
`basic_ostream<charT, traits>&` and value `out`.
|
| 134 |
|