- tmp/tmpvhnurqlt/{from.md → to.md} +142 -140
tmp/tmpvhnurqlt/{from.md → to.md}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
-
## Standard `locale` categories <a id="locale.categories">[[locale.categories]]</a>
|
| 2 |
|
| 3 |
-
### General <a id="locale.categories.general">[[locale.categories.general]]</a>
|
| 4 |
|
| 5 |
Each of the standard categories includes a family of facets. Some of
|
| 6 |
these implement formatting or parsing of a datum, for use by standard or
|
| 7 |
users’ iostream operators `<<` and `>>`, as members `put()` and `get()`,
|
| 8 |
respectively. Each such member function takes an `ios_base&` argument
|
|
@@ -16,45 +16,45 @@ The `put()` members make no provision for error reporting. (Any failures
|
|
| 16 |
of the OutputIterator argument can be extracted from the returned
|
| 17 |
iterator.) The `get()` members take an `ios_base::iostate&` argument
|
| 18 |
whose value they ignore, but set to `ios_base::failbit` in case of a
|
| 19 |
parse error.
|
| 20 |
|
| 21 |
-
Within
|
| 22 |
-
|
| 23 |
|
| 24 |
-
### The `ctype` category <a id="category.ctype">[[category.ctype]]</a>
|
| 25 |
|
| 26 |
-
#### General <a id="category.ctype.general">[[category.ctype.general]]</a>
|
| 27 |
|
| 28 |
``` cpp
|
| 29 |
namespace std {
|
| 30 |
class ctype_base {
|
| 31 |
public:
|
| 32 |
using mask = see below;
|
| 33 |
|
| 34 |
// numeric values are for exposition only.
|
| 35 |
-
static
|
| 36 |
-
static
|
| 37 |
-
static
|
| 38 |
-
static
|
| 39 |
-
static
|
| 40 |
-
static
|
| 41 |
-
static
|
| 42 |
-
static
|
| 43 |
-
static
|
| 44 |
-
static
|
| 45 |
-
static
|
| 46 |
-
static
|
| 47 |
};
|
| 48 |
}
|
| 49 |
```
|
| 50 |
|
| 51 |
The type `mask` is a bitmask type [[bitmask.types]].
|
| 52 |
|
| 53 |
-
#### Class template `ctype` <a id="locale.ctype">[[locale.ctype]]</a>
|
| 54 |
|
| 55 |
-
##### General <a id="locale.ctype.general">[[locale.ctype.general]]</a>
|
| 56 |
|
| 57 |
``` cpp
|
| 58 |
namespace std {
|
| 59 |
template<class charT>
|
| 60 |
class ctype : public locale::facet, public ctype_base {
|
|
@@ -105,11 +105,11 @@ input parsing.
|
|
| 105 |
The specializations required in [[locale.category.facets]]
|
| 106 |
[[locale.category]], namely `ctype<char>` and `ctype<wchar_t>`,
|
| 107 |
implement character classing appropriate to the implementation’s native
|
| 108 |
character set.
|
| 109 |
|
| 110 |
-
##### `ctype` members <a id="locale.ctype.members">[[locale.ctype.members]]</a>
|
| 111 |
|
| 112 |
``` cpp
|
| 113 |
bool is(mask m, charT c) const;
|
| 114 |
const charT* is(const charT* low, const charT* high, mask* vec) const;
|
| 115 |
```
|
|
@@ -127,11 +127,11 @@ const charT* scan_not(mask m, const charT* low, const charT* high) const;
|
|
| 127 |
```
|
| 128 |
|
| 129 |
*Returns:* `do_scan_not(m, low, high)`.
|
| 130 |
|
| 131 |
``` cpp
|
| 132 |
-
charT toupper(charT) const;
|
| 133 |
const charT* toupper(charT* low, const charT* high) const;
|
| 134 |
```
|
| 135 |
|
| 136 |
*Returns:* `do_toupper(c)` or `do_toupper(low, high)`.
|
| 137 |
|
|
@@ -154,11 +154,11 @@ char narrow(charT c, char dfault) const;
|
|
| 154 |
const charT* narrow(const charT* low, const charT* high, char dfault, char* to) const;
|
| 155 |
```
|
| 156 |
|
| 157 |
*Returns:* `do_narrow(c, dfault)` or `do_narrow(low, high, dfault, to)`.
|
| 158 |
|
| 159 |
-
##### `ctype` virtual functions <a id="locale.ctype.virtuals">[[locale.ctype.virtuals]]</a>
|
| 160 |
|
| 161 |
``` cpp
|
| 162 |
bool do_is(mask m, charT c) const;
|
| 163 |
const charT* do_is(const charT* low, const charT* high, mask* vec) const;
|
| 164 |
```
|
|
@@ -230,11 +230,11 @@ value or sequence of `char` values to the corresponding `charT` value or
|
|
| 230 |
values.[^5]
|
| 231 |
|
| 232 |
The only characters for which unique transformations are required are
|
| 233 |
those in the basic character set [[lex.charset]].
|
| 234 |
|
| 235 |
-
For any named `ctype` category with a `ctype<
|
| 236 |
valid `ctype_base::mask` value `M`,
|
| 237 |
`(ctc.is(M, c) || !is(M, do_widen(c)) )` is `true`.[^6]
|
| 238 |
|
| 239 |
The second form transforms each character `*p` in the range \[`low`,
|
| 240 |
`high`), placing the result in `dest[p - low]`.
|
|
@@ -273,30 +273,30 @@ the result (or `dfault` if no simple transformation is readily
|
|
| 273 |
available) in `dest[p - low]`.
|
| 274 |
|
| 275 |
*Returns:* The first form returns the transformed value; or `dfault` if
|
| 276 |
no mapping is readily available. The second form returns `high`.
|
| 277 |
|
| 278 |
-
#### Class template `ctype_byname` <a id="locale.ctype.byname">[[locale.ctype.byname]]</a>
|
| 279 |
|
| 280 |
``` cpp
|
| 281 |
namespace std {
|
| 282 |
template<class charT>
|
| 283 |
class ctype_byname : public ctype<charT> {
|
| 284 |
public:
|
| 285 |
-
using mask =
|
| 286 |
explicit ctype_byname(const char*, size_t refs = 0);
|
| 287 |
explicit ctype_byname(const string&, size_t refs = 0);
|
| 288 |
|
| 289 |
protected:
|
| 290 |
~ctype_byname();
|
| 291 |
};
|
| 292 |
}
|
| 293 |
```
|
| 294 |
|
| 295 |
-
#### `ctype<char>` specialization <a id="facet.ctype.special">[[facet.ctype.special]]</a>
|
| 296 |
|
| 297 |
-
##### General <a id="facet.ctype.special.general">[[facet.ctype.special.general]]</a>
|
| 298 |
|
| 299 |
``` cpp
|
| 300 |
namespace std {
|
| 301 |
template<>
|
| 302 |
class ctype<char> : public locale::facet, public ctype_base {
|
|
@@ -346,20 +346,20 @@ A specialization `ctype<char>` is provided so that the member functions
|
|
| 346 |
on type `char` can be implemented inline.[^7]
|
| 347 |
|
| 348 |
The *implementation-defined* value of member `table_size` is at least
|
| 349 |
256.
|
| 350 |
|
| 351 |
-
##### Destructor <a id="facet.ctype.char.dtor">[[facet.ctype.char.dtor]]</a>
|
| 352 |
|
| 353 |
``` cpp
|
| 354 |
~ctype();
|
| 355 |
```
|
| 356 |
|
| 357 |
*Effects:* If the constructor’s first argument was nonzero, and its
|
| 358 |
second argument was `true`, does `delete [] table()`.
|
| 359 |
|
| 360 |
-
##### Members <a id="facet.ctype.char.members">[[facet.ctype.char.members]]</a>
|
| 361 |
|
| 362 |
In the following member descriptions, for `unsigned char` values `v`
|
| 363 |
where `v >= table_size`, `table()[v]` is assumed to have an
|
| 364 |
implementation-specific value (possibly different for each such value
|
| 365 |
`v`) without performing the array lookup.
|
|
@@ -442,21 +442,21 @@ const mask* table() const noexcept;
|
|
| 442 |
```
|
| 443 |
|
| 444 |
*Returns:* The first constructor argument, if it was nonzero, otherwise
|
| 445 |
`classic_table()`.
|
| 446 |
|
| 447 |
-
##### Static members <a id="facet.ctype.char.statics">[[facet.ctype.char.statics]]</a>
|
| 448 |
|
| 449 |
``` cpp
|
| 450 |
static const mask* classic_table() noexcept;
|
| 451 |
```
|
| 452 |
|
| 453 |
*Returns:* A pointer to the initial element of an array of size
|
| 454 |
`table_size` which represents the classifications of characters in the
|
| 455 |
`"C"` locale.
|
| 456 |
|
| 457 |
-
##### Virtual functions <a id="facet.ctype.char.virtuals">[[facet.ctype.char.virtuals]]</a>
|
| 458 |
|
| 459 |
``` cpp
|
| 460 |
char do_toupper(char) const;
|
| 461 |
const char* do_toupper(char* low, const char* high) const;
|
| 462 |
char do_tolower(char) const;
|
|
@@ -470,13 +470,13 @@ virtual const char* do_narrow(const char* low, const char* high,
|
|
| 470 |
```
|
| 471 |
|
| 472 |
These functions are described identically as those members of the same
|
| 473 |
name in the `ctype` class template [[locale.ctype.members]].
|
| 474 |
|
| 475 |
-
#### Class template `codecvt` <a id="locale.codecvt">[[locale.codecvt]]</a>
|
| 476 |
|
| 477 |
-
##### General <a id="locale.codecvt.general">[[locale.codecvt.general]]</a>
|
| 478 |
|
| 479 |
``` cpp
|
| 480 |
namespace std {
|
| 481 |
class codecvt_base {
|
| 482 |
public:
|
|
@@ -544,23 +544,20 @@ The `stateT` argument selects the pair of character encodings being
|
|
| 544 |
mapped between.
|
| 545 |
|
| 546 |
The specializations required in [[locale.category.facets]]
|
| 547 |
[[locale.category]] convert the implementation-defined native character
|
| 548 |
set. `codecvt<char, char, mbstate_t>` implements a degenerate
|
| 549 |
-
conversion; it does not convert at all.
|
| 550 |
-
`codecvt<
|
| 551 |
-
|
| 552 |
-
`
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
specializing on a program-defined `stateT` type. Objects of type
|
| 558 |
-
`stateT` can contain any state that is useful to communicate to or from
|
| 559 |
-
the specialized `do_in` or `do_out` members.
|
| 560 |
|
| 561 |
-
##### Members <a id="locale.codecvt.members">[[locale.codecvt.members]]</a>
|
| 562 |
|
| 563 |
``` cpp
|
| 564 |
result out(
|
| 565 |
stateT& state,
|
| 566 |
const internT* from, const internT* from_end, const internT*& from_next,
|
|
@@ -608,11 +605,11 @@ int length(stateT& state, const externT* from, const externT* from_end, size_t m
|
|
| 608 |
int max_length() const noexcept;
|
| 609 |
```
|
| 610 |
|
| 611 |
*Returns:* `do_max_length()`.
|
| 612 |
|
| 613 |
-
##### Virtual functions <a id="locale.codecvt.virtuals">[[locale.codecvt.virtuals]]</a>
|
| 614 |
|
| 615 |
``` cpp
|
| 616 |
result do_out(
|
| 617 |
stateT& state,
|
| 618 |
const internT* from, const internT* from_end, const internT*& from_next,
|
|
@@ -634,13 +631,13 @@ the sequence.
|
|
| 634 |
destination `to`. Converts no more than `(from_end - from)` source
|
| 635 |
elements, and stores no more than `(to_end - to)` destination elements.
|
| 636 |
|
| 637 |
Stops if it encounters a character it cannot convert. It always leaves
|
| 638 |
the `from_next` and `to_next` pointers pointing one beyond the last
|
| 639 |
-
element successfully converted. If returns `noconv`, `internT` and
|
| 640 |
-
`externT` are the same type and the converted sequence is identical to
|
| 641 |
-
the input sequence \[`from`, `from``next`)
|
| 642 |
`to`, the value of `state` is unchanged, and there are no changes to the
|
| 643 |
values in \[`to`, `to_end`).
|
| 644 |
|
| 645 |
A `codecvt` facet that is used by `basic_filebuf` [[file.streams]] shall
|
| 646 |
have the property that if
|
|
@@ -751,14 +748,14 @@ sequence.
|
|
| 751 |
|
| 752 |
*Effects:* The effect on the `state` argument is as if it called
|
| 753 |
`do_in(state, from, from_end, from, to, to + max, to)` for `to` pointing
|
| 754 |
to a buffer of at least `max` elements.
|
| 755 |
|
| 756 |
-
*Returns:* `(from_next-from)` where `from_next` is the largest value
|
| 757 |
-
the range \[`from`, `from_end`\] such that the sequence of values in
|
| 758 |
-
range \[`from`, `from_next`) represents `max` or fewer valid
|
| 759 |
-
characters of type `internT`. The specialization
|
| 760 |
`codecvt<char, char, mbstate_t>`, returns the lesser of `max` and
|
| 761 |
`(from_end - from)`.
|
| 762 |
|
| 763 |
``` cpp
|
| 764 |
int do_max_length() const noexcept;
|
|
@@ -767,11 +764,11 @@ int do_max_length() const noexcept;
|
|
| 767 |
*Returns:* The maximum value that `do_length(state, from, from_end, 1)`
|
| 768 |
can return for any valid range \[`from`, `from_end`) and `stateT` value
|
| 769 |
`state`. The specialization
|
| 770 |
`codecvt<char, char, mbstate_t>::do_max_length()` returns 1.
|
| 771 |
|
| 772 |
-
#### Class template `codecvt_byname` <a id="locale.codecvt.byname">[[locale.codecvt.byname]]</a>
|
| 773 |
|
| 774 |
``` cpp
|
| 775 |
namespace std {
|
| 776 |
template<class internT, class externT, class stateT>
|
| 777 |
class codecvt_byname : public codecvt<internT, externT, stateT> {
|
|
@@ -783,13 +780,13 @@ namespace std {
|
|
| 783 |
~codecvt_byname();
|
| 784 |
};
|
| 785 |
}
|
| 786 |
```
|
| 787 |
|
| 788 |
-
### The numeric category <a id="category.numeric">[[category.numeric]]</a>
|
| 789 |
|
| 790 |
-
#### General <a id="category.numeric.general">[[category.numeric.general]]</a>
|
| 791 |
|
| 792 |
The classes `num_get<>` and `num_put<>` handle numeric formatting and
|
| 793 |
parsing. Virtual functions are provided for several numeric types.
|
| 794 |
Implementations may (but are not required to) delegate extraction of
|
| 795 |
smaller types to extractors for larger types.[^11]
|
|
@@ -807,13 +804,13 @@ also for the `ctype<>` facet to perform character classification.
|
|
| 807 |
|
| 808 |
Extractor and inserter members of the standard iostreams use `num_get<>`
|
| 809 |
and `num_put<>` member functions for formatting and parsing numeric
|
| 810 |
values [[istream.formatted.reqmts]], [[ostream.formatted.reqmts]].
|
| 811 |
|
| 812 |
-
#### Class template `num_get` <a id="locale.num.get">[[locale.num.get]]</a>
|
| 813 |
|
| 814 |
-
##### General <a id="locale.num.get.general">[[locale.num.get.general]]</a>
|
| 815 |
|
| 816 |
``` cpp
|
| 817 |
namespace std {
|
| 818 |
template<class charT, class InputIterator = istreambuf_iterator<charT>>
|
| 819 |
class num_get : public locale::facet {
|
|
@@ -877,11 +874,11 @@ namespace std {
|
|
| 877 |
```
|
| 878 |
|
| 879 |
The facet `num_get` is used to parse numeric values from an input
|
| 880 |
sequence such as an istream.
|
| 881 |
|
| 882 |
-
##### Members <a id="facet.num.get.members">[[facet.num.get.members]]</a>
|
| 883 |
|
| 884 |
``` cpp
|
| 885 |
iter_type get(iter_type in, iter_type end, ios_base& str,
|
| 886 |
ios_base::iostate& err, bool& val) const;
|
| 887 |
iter_type get(iter_type in, iter_type end, ios_base& str,
|
|
@@ -906,11 +903,11 @@ iter_type get(iter_type in, iter_type end, ios_base& str,
|
|
| 906 |
ios_base::iostate& err, void*& val) const;
|
| 907 |
```
|
| 908 |
|
| 909 |
*Returns:* `do_get(in, end, str, err, val)`.
|
| 910 |
|
| 911 |
-
##### Virtual functions <a id="facet.num.get.virtuals">[[facet.num.get.virtuals]]</a>
|
| 912 |
|
| 913 |
``` cpp
|
| 914 |
iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
| 915 |
ios_base::iostate& err, long& val) const;
|
| 916 |
iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
|
@@ -935,17 +932,17 @@ iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
|
| 935 |
|
| 936 |
*Effects:* Reads characters from `in`, interpreting them according to
|
| 937 |
`str.flags()`, `use_facet<ctype<charT>>(loc)`, and
|
| 938 |
`use_facet<numpunct<charT>>(loc)`, where `loc` is `str.getloc()`.
|
| 939 |
|
| 940 |
-
The details of this operation occur in three stages
|
| 941 |
|
| 942 |
-
- Stage 1: Determine a conversion specifier
|
| 943 |
- Stage 2: Extract characters from `in` and determine a corresponding
|
| 944 |
`char` value for the format expected by the conversion specification
|
| 945 |
determined in stage 1.
|
| 946 |
-
- Stage 3: Store results
|
| 947 |
|
| 948 |
The details of the stages are presented below.
|
| 949 |
|
| 950 |
[*Example 1*:
|
| 951 |
|
|
@@ -995,12 +992,12 @@ Otherwise `false` is stored and `ios_base::failbit` is assigned to
|
|
| 995 |
|
| 996 |
The `in` iterator is always left pointing one position beyond the last
|
| 997 |
character successfully matched. If `val` is set, then `err` is set to
|
| 998 |
`str.goodbit`; or to `str.eofbit` if, when seeking another character to
|
| 999 |
match, it is found that `(in == end)`. If `val` is not set, then `err`
|
| 1000 |
-
is set to `str.failbit`; or to `(str.failbit|str.eofbit)` if the
|
| 1001 |
-
for the failure was that `(in == end)`.
|
| 1002 |
|
| 1003 |
[*Example 2*: For targets `true`: `"a"` and `false`: `"abb"`, the input
|
| 1004 |
sequence `"a"` yields `val == true` and `err == str.eofbit`; the input
|
| 1005 |
sequence `"abc"` yields `err = str.failbit`, with `in` ending at the
|
| 1006 |
`’c’` element. For targets `true`: `"1"` and `false`: `"0"`, the input
|
|
@@ -1008,13 +1005,13 @@ sequence `"1"` yields `val == true` and `err == str.goodbit`. For empty
|
|
| 1008 |
targets `("")`, any input sequence yields
|
| 1009 |
`err == str.failbit`. — *end example*]
|
| 1010 |
|
| 1011 |
*Returns:* `in`.
|
| 1012 |
|
| 1013 |
-
#### Class template `num_put` <a id="locale.nm.put">[[locale.nm.put]]</a>
|
| 1014 |
|
| 1015 |
-
##### General <a id="locale.nm.put.general">[[locale.nm.put.general]]</a>
|
| 1016 |
|
| 1017 |
``` cpp
|
| 1018 |
namespace std {
|
| 1019 |
template<class charT, class OutputIterator = ostreambuf_iterator<charT>>
|
| 1020 |
class num_put : public locale::facet {
|
|
@@ -1050,11 +1047,11 @@ namespace std {
|
|
| 1050 |
```
|
| 1051 |
|
| 1052 |
The facet `num_put` is used to format numeric values to a character
|
| 1053 |
sequence such as an ostream.
|
| 1054 |
|
| 1055 |
-
##### Members <a id="facet.num.put.members">[[facet.num.put.members]]</a>
|
| 1056 |
|
| 1057 |
``` cpp
|
| 1058 |
iter_type put(iter_type out, ios_base& str, char_type fill, bool val) const;
|
| 1059 |
iter_type put(iter_type out, ios_base& str, char_type fill, long val) const;
|
| 1060 |
iter_type put(iter_type out, ios_base& str, char_type fill, long long val) const;
|
|
@@ -1065,11 +1062,11 @@ iter_type put(iter_type out, ios_base& str, char_type fill, long double val) con
|
|
| 1065 |
iter_type put(iter_type out, ios_base& str, char_type fill, const void* val) const;
|
| 1066 |
```
|
| 1067 |
|
| 1068 |
*Returns:* `do_put(out, str, fill, val)`.
|
| 1069 |
|
| 1070 |
-
##### Virtual functions <a id="facet.num.put.virtuals">[[facet.num.put.virtuals]]</a>
|
| 1071 |
|
| 1072 |
``` cpp
|
| 1073 |
iter_type do_put(iter_type out, ios_base& str, char_type fill, long val) const;
|
| 1074 |
iter_type do_put(iter_type out, ios_base& str, char_type fill, long long val) const;
|
| 1075 |
iter_type do_put(iter_type out, ios_base& str, char_type fill, unsigned long val) const;
|
|
@@ -1148,11 +1145,12 @@ floating-point conversion specifier as indicated in
|
|
| 1148 |
|
| 1149 |
**Table: Floating-point conversions** <a id="facet.num.put.fp">[facet.num.put.fp]</a>
|
| 1150 |
|
| 1151 |
| State | `stdio` equivalent |
|
| 1152 |
| ---------------------------------------------------------------------- | ------------------ |
|
| 1153 |
-
| `floatfield == ios_base::fixed`
|
|
|
|
| 1154 |
| `floatfield == ios_base::scientific && !uppercase` | `%e` |
|
| 1155 |
| `floatfield == ios_base::scientific` | `%E` |
|
| 1156 |
| `floatfield == (ios_base::fixed | ios_base::scientific) && !uppercase` | `%a` |
|
| 1157 |
| `floatfield == (ios_base::fixed | ios_base::scientific)` | `%A` |
|
| 1158 |
| `!uppercase` | `%g` |
|
|
@@ -1274,15 +1272,15 @@ string_type s =
|
|
| 1274 |
```
|
| 1275 |
|
| 1276 |
and then inserts each character `c` of `s` into `out` via `*out++ = c`
|
| 1277 |
and returns `out`.
|
| 1278 |
|
| 1279 |
-
### The numeric punctuation facet <a id="facet.numpunct">[[facet.numpunct]]</a>
|
| 1280 |
|
| 1281 |
-
#### Class template `numpunct` <a id="locale.numpunct">[[locale.numpunct]]</a>
|
| 1282 |
|
| 1283 |
-
##### General <a id="locale.numpunct.general">[[locale.numpunct.general]]</a>
|
| 1284 |
|
| 1285 |
``` cpp
|
| 1286 |
namespace std {
|
| 1287 |
template<class charT>
|
| 1288 |
class numpunct : public locale::facet {
|
|
@@ -1371,11 +1369,11 @@ e:
|
|
| 1371 |
|
| 1372 |
where the number of digits between is as specified by `do_grouping()`.
|
| 1373 |
For parsing, if the portion contains no thousands-separators, no
|
| 1374 |
grouping constraint is applied.
|
| 1375 |
|
| 1376 |
-
##### Members <a id="facet.numpunct.members">[[facet.numpunct.members]]</a>
|
| 1377 |
|
| 1378 |
``` cpp
|
| 1379 |
char_type decimal_point() const;
|
| 1380 |
```
|
| 1381 |
|
|
@@ -1398,11 +1396,11 @@ string_type truename() const;
|
|
| 1398 |
string_type falsename() const;
|
| 1399 |
```
|
| 1400 |
|
| 1401 |
*Returns:* `do_truename()` or `do_falsename()`, respectively.
|
| 1402 |
|
| 1403 |
-
##### Virtual functions <a id="facet.numpunct.virtuals">[[facet.numpunct.virtuals]]</a>
|
| 1404 |
|
| 1405 |
``` cpp
|
| 1406 |
char_type do_decimal_point() const;
|
| 1407 |
```
|
| 1408 |
|
|
@@ -1440,11 +1438,11 @@ string_type do_falsename() const;
|
|
| 1440 |
`false`, respectively.
|
| 1441 |
|
| 1442 |
In the base class implementation these names are `"true"` and `"false"`,
|
| 1443 |
or `L"true"` and `L"false"`.
|
| 1444 |
|
| 1445 |
-
#### Class template `numpunct_byname` <a id="locale.numpunct.byname">[[locale.numpunct.byname]]</a>
|
| 1446 |
|
| 1447 |
``` cpp
|
| 1448 |
namespace std {
|
| 1449 |
template<class charT>
|
| 1450 |
class numpunct_byname : public numpunct<charT> {
|
|
@@ -1460,15 +1458,15 @@ namespace std {
|
|
| 1460 |
~numpunct_byname();
|
| 1461 |
};
|
| 1462 |
}
|
| 1463 |
```
|
| 1464 |
|
| 1465 |
-
### The collate category <a id="category.collate">[[category.collate]]</a>
|
| 1466 |
|
| 1467 |
-
#### Class template `collate` <a id="locale.collate">[[locale.collate]]</a>
|
| 1468 |
|
| 1469 |
-
##### General <a id="locale.collate.general">[[locale.collate.general]]</a>
|
| 1470 |
|
| 1471 |
``` cpp
|
| 1472 |
namespace std {
|
| 1473 |
template<class charT>
|
| 1474 |
class collate : public locale::facet {
|
|
@@ -1505,11 +1503,11 @@ and `collate<wchar_t>`, apply lexicographical ordering
|
|
| 1505 |
[[alg.lex.comparison]].
|
| 1506 |
|
| 1507 |
Each function compares a string of characters `*p` in the range \[`low`,
|
| 1508 |
`high`).
|
| 1509 |
|
| 1510 |
-
##### Members <a id="locale.collate.members">[[locale.collate.members]]</a>
|
| 1511 |
|
| 1512 |
``` cpp
|
| 1513 |
int compare(const charT* low1, const charT* high1,
|
| 1514 |
const charT* low2, const charT* high2) const;
|
| 1515 |
```
|
|
@@ -1526,11 +1524,11 @@ string_type transform(const charT* low, const charT* high) const;
|
|
| 1526 |
long hash(const charT* low, const charT* high) const;
|
| 1527 |
```
|
| 1528 |
|
| 1529 |
*Returns:* `do_hash(low, high)`.
|
| 1530 |
|
| 1531 |
-
##### Virtual functions <a id="locale.collate.virtuals">[[locale.collate.virtuals]]</a>
|
| 1532 |
|
| 1533 |
``` cpp
|
| 1534 |
int do_compare(const charT* low1, const charT* high1,
|
| 1535 |
const charT* low2, const charT* high2) const;
|
| 1536 |
```
|
|
@@ -1560,11 +1558,11 @@ the two strings.
|
|
| 1560 |
|
| 1561 |
*Recommended practice:* The probability that the result equals that for
|
| 1562 |
another string which does not compare equal should be very small,
|
| 1563 |
approaching `(1.0/numeric_limits<unsigned long>::max())`.
|
| 1564 |
|
| 1565 |
-
#### Class template `collate_byname` <a id="locale.collate.byname">[[locale.collate.byname]]</a>
|
| 1566 |
|
| 1567 |
``` cpp
|
| 1568 |
namespace std {
|
| 1569 |
template<class charT>
|
| 1570 |
class collate_byname : public collate<charT> {
|
|
@@ -1578,13 +1576,13 @@ namespace std {
|
|
| 1578 |
~collate_byname();
|
| 1579 |
};
|
| 1580 |
}
|
| 1581 |
```
|
| 1582 |
|
| 1583 |
-
### The time category <a id="category.time">[[category.time]]</a>
|
| 1584 |
|
| 1585 |
-
#### General <a id="category.time.general">[[category.time.general]]</a>
|
| 1586 |
|
| 1587 |
Templates `time_get<charT, InputIterator>` and
|
| 1588 |
`time_put<charT, OutputIterator>` provide date and time formatting and
|
| 1589 |
parsing. All specifications of member functions for `time_put` and
|
| 1590 |
`time_get` in the subclauses of [[category.time]] only apply to the
|
|
@@ -1592,13 +1590,13 @@ specializations required in Tables [[tab:locale.category.facets]] and
|
|
| 1592 |
[[tab:locale.spec]] [[locale.category]]. Their members use their
|
| 1593 |
`ios_base&`, `ios_base::iostate&`, and `fill` arguments as described in
|
| 1594 |
[[locale.categories]], and the `ctype<>` facet, to determine formatting
|
| 1595 |
details.
|
| 1596 |
|
| 1597 |
-
#### Class template `time_get` <a id="locale.time.get">[[locale.time.get]]</a>
|
| 1598 |
|
| 1599 |
-
##### General <a id="locale.time.get.general">[[locale.time.get.general]]</a>
|
| 1600 |
|
| 1601 |
``` cpp
|
| 1602 |
namespace std {
|
| 1603 |
class time_base {
|
| 1604 |
public:
|
|
@@ -1660,11 +1658,11 @@ sequence; otherwise either an error is reported or unspecified values
|
|
| 1660 |
are assigned.[^15]
|
| 1661 |
|
| 1662 |
If the end iterator is reached during parsing by any of the `get()`
|
| 1663 |
member functions, the member sets `ios_base::eofbit` in `err`.
|
| 1664 |
|
| 1665 |
-
##### Members <a id="locale.time.get.members">[[locale.time.get.members]]</a>
|
| 1666 |
|
| 1667 |
``` cpp
|
| 1668 |
dateorder date_order() const;
|
| 1669 |
```
|
| 1670 |
|
|
@@ -1753,11 +1751,11 @@ by what means the function performs case-insensitive comparison or
|
|
| 1753 |
whether multi-character sequences are considered while doing
|
| 1754 |
so. — *end note*]
|
| 1755 |
|
| 1756 |
*Returns:* `s`.
|
| 1757 |
|
| 1758 |
-
##### Virtual functions <a id="locale.time.get.virtuals">[[locale.time.get.virtuals]]</a>
|
| 1759 |
|
| 1760 |
``` cpp
|
| 1761 |
dateorder do_date_order() const;
|
| 1762 |
```
|
| 1763 |
|
|
@@ -1871,11 +1869,11 @@ recognized as possibly part of a valid input sequence for the given
|
|
| 1871 |
*Remarks:* It is unspecified whether multiple calls to `do_get()` with
|
| 1872 |
the address of the same `tm` object will update the current contents of
|
| 1873 |
the object or simply overwrite its members. Portable programs should
|
| 1874 |
zero out the object before invoking the function.
|
| 1875 |
|
| 1876 |
-
#### Class template `time_get_byname` <a id="locale.time.get.byname">[[locale.time.get.byname]]</a>
|
| 1877 |
|
| 1878 |
``` cpp
|
| 1879 |
namespace std {
|
| 1880 |
template<class charT, class InputIterator = istreambuf_iterator<charT>>
|
| 1881 |
class time_get_byname : public time_get<charT, InputIterator> {
|
|
@@ -1890,11 +1888,13 @@ namespace std {
|
|
| 1890 |
~time_get_byname();
|
| 1891 |
};
|
| 1892 |
}
|
| 1893 |
```
|
| 1894 |
|
| 1895 |
-
#### Class template `time_put` <a id="locale.time.put">[[locale.time.put]]</a>
|
|
|
|
|
|
|
| 1896 |
|
| 1897 |
``` cpp
|
| 1898 |
namespace std {
|
| 1899 |
template<class charT, class OutputIterator = ostreambuf_iterator<charT>>
|
| 1900 |
class time_put : public locale::facet {
|
|
@@ -1918,11 +1918,11 @@ namespace std {
|
|
| 1918 |
char format, char modifier) const;
|
| 1919 |
};
|
| 1920 |
}
|
| 1921 |
```
|
| 1922 |
|
| 1923 |
-
##### Members <a id="locale.time.put.members">[[locale.time.put.members]]</a>
|
| 1924 |
|
| 1925 |
``` cpp
|
| 1926 |
iter_type put(iter_type s, ios_base& str, char_type fill, const tm* t,
|
| 1927 |
const charT* pattern, const charT* pat_end) const;
|
| 1928 |
iter_type put(iter_type s, ios_base& str, char_type fill, const tm* t,
|
|
@@ -1937,27 +1937,25 @@ call to `do_put`; thus, format elements and other characters are
|
|
| 1937 |
interleaved in the output in the order in which they appear in the
|
| 1938 |
pattern. Format sequences are identified by converting each character
|
| 1939 |
`c` to a `char` value as if by `ct.narrow(c, 0)`, where `ct` is a
|
| 1940 |
reference to `ctype<charT>` obtained from `str.getloc()`. The first
|
| 1941 |
character of each sequence is equal to `’%’`, followed by an optional
|
| 1942 |
-
modifier character `mod`
|
| 1943 |
-
|
| 1944 |
-
|
| 1945 |
-
`strftime`. If no modifier character is present, `mod` is zero. For each
|
| 1946 |
-
valid format sequence identified, calls
|
| 1947 |
`do_put(s, str, fill, t, spec, mod)`.
|
| 1948 |
|
| 1949 |
The second form calls `do_put(s, str, fill, t, format, modifier)`.
|
| 1950 |
|
| 1951 |
-
[*Note
|
| 1952 |
implementation-defined formats or by derivations. A space character is a
|
| 1953 |
reasonable default for this argument. — *end note*]
|
| 1954 |
|
| 1955 |
*Returns:* An iterator pointing immediately after the last character
|
| 1956 |
produced.
|
| 1957 |
|
| 1958 |
-
##### Virtual functions <a id="locale.time.put.virtuals">[[locale.time.put.virtuals]]</a>
|
| 1959 |
|
| 1960 |
``` cpp
|
| 1961 |
iter_type do_put(iter_type s, ios_base&, char_type fill, const tm* t,
|
| 1962 |
char format, char modifier) const;
|
| 1963 |
```
|
|
@@ -1968,26 +1966,26 @@ parameters `format` and `modifier`, interpreted identically as the
|
|
| 1968 |
format specifiers in the string argument to the standard library
|
| 1969 |
function `strftime()`, except that the sequence of characters produced
|
| 1970 |
for those specifiers that are described as depending on the C locale are
|
| 1971 |
instead *implementation-defined*.
|
| 1972 |
|
| 1973 |
-
[*Note
|
| 1974 |
implementation-defined. — *end note*]
|
| 1975 |
|
| 1976 |
*Returns:* An iterator pointing immediately after the last character
|
| 1977 |
produced.
|
| 1978 |
|
| 1979 |
-
[*Note
|
| 1980 |
implementation-defined formats or by derivations. A space character is a
|
| 1981 |
reasonable default for this argument. — *end note*]
|
| 1982 |
|
| 1983 |
*Recommended practice:* Interpretation of the `modifier` should follow
|
| 1984 |
POSIX conventions. Implementations should refer to other standards such
|
| 1985 |
as POSIX for a specification of the character sequences produced for
|
| 1986 |
those specifiers described as depending on the C locale.
|
| 1987 |
|
| 1988 |
-
#### Class template `time_put_byname` <a id="locale.time.put.byname">[[locale.time.put.byname]]</a>
|
| 1989 |
|
| 1990 |
``` cpp
|
| 1991 |
namespace std {
|
| 1992 |
template<class charT, class OutputIterator = ostreambuf_iterator<charT>>
|
| 1993 |
class time_put_byname : public time_put<charT, OutputIterator> {
|
|
@@ -2002,13 +2000,13 @@ namespace std {
|
|
| 2002 |
~time_put_byname();
|
| 2003 |
};
|
| 2004 |
}
|
| 2005 |
```
|
| 2006 |
|
| 2007 |
-
### The monetary category <a id="category.monetary">[[category.monetary]]</a>
|
| 2008 |
|
| 2009 |
-
#### General <a id="category.monetary.general">[[category.monetary.general]]</a>
|
| 2010 |
|
| 2011 |
These templates handle monetary formats. A template parameter indicates
|
| 2012 |
whether local or international monetary formats are to be used.
|
| 2013 |
|
| 2014 |
All specifications of member functions for `money_put` and `money_get`
|
|
@@ -2017,11 +2015,13 @@ specializations required in Tables [[tab:locale.category.facets]] and
|
|
| 2017 |
[[tab:locale.spec]] [[locale.category]]. Their members use their
|
| 2018 |
`ios_base&`, `ios_base::iostate&`, and `fill` arguments as described in
|
| 2019 |
[[locale.categories]], and the `moneypunct<>` and `ctype<>` facets, to
|
| 2020 |
determine formatting details.
|
| 2021 |
|
| 2022 |
-
#### Class template `money_get` <a id="locale.money.get">[[locale.money.get]]</a>
|
|
|
|
|
|
|
| 2023 |
|
| 2024 |
``` cpp
|
| 2025 |
namespace std {
|
| 2026 |
template<class charT, class InputIterator = istreambuf_iterator<charT>>
|
| 2027 |
class money_get : public locale::facet {
|
|
@@ -2049,22 +2049,22 @@ namespace std {
|
|
| 2049 |
ios_base::iostate& err, string_type& digits) const;
|
| 2050 |
};
|
| 2051 |
}
|
| 2052 |
```
|
| 2053 |
|
| 2054 |
-
##### Members <a id="locale.money.get.members">[[locale.money.get.members]]</a>
|
| 2055 |
|
| 2056 |
``` cpp
|
| 2057 |
iter_type get(iter_type s, iter_type end, bool intl, ios_base& f,
|
| 2058 |
ios_base::iostate& err, long double& quant) const;
|
| 2059 |
iter_type get(iter_type s, iter_type end, bool intl, ios_base& f,
|
| 2060 |
ios_base::iostate& err, string_type& quant) const;
|
| 2061 |
```
|
| 2062 |
|
| 2063 |
*Returns:* `do_get(s, end, intl, f, err, quant)`.
|
| 2064 |
|
| 2065 |
-
##### Virtual functions <a id="locale.money.get.virtuals">[[locale.money.get.virtuals]]</a>
|
| 2066 |
|
| 2067 |
``` cpp
|
| 2068 |
iter_type do_get(iter_type s, iter_type end, bool intl, ios_base& str,
|
| 2069 |
ios_base::iostate& err, long double& units) const;
|
| 2070 |
iter_type do_get(iter_type s, iter_type end, bool intl, ios_base& str,
|
|
@@ -2074,18 +2074,18 @@ iter_type do_get(iter_type s, iter_type end, bool intl, ios_base& str,
|
|
| 2074 |
*Effects:* Reads characters from `s` to parse and construct a monetary
|
| 2075 |
value according to the format specified by a `moneypunct<charT, Intl>`
|
| 2076 |
facet reference `mp` and the character mapping specified by a
|
| 2077 |
`ctype<charT>` facet reference `ct` obtained from the locale returned by
|
| 2078 |
`str.getloc()`, and `str.flags()`. If a valid sequence is recognized,
|
| 2079 |
-
does not change `err`; otherwise, sets `err` to `(err|str.failbit)`,
|
| 2080 |
-
`(err|str.failbit|str.eofbit)` if no more characters are
|
| 2081 |
-
does not change `units` or `digits`. Uses the pattern
|
| 2082 |
-
`mp.neg_format()` to parse all values. The result is
|
| 2083 |
-
integral value stored in `units` or as a sequence of
|
| 2084 |
-
preceded by a minus sign (as produced by `ct.widen(c)`
|
| 2085 |
-
`’-’` or in the range from `’0’` through `’9’` (inclusive))
|
| 2086 |
-
`digits`.
|
| 2087 |
|
| 2088 |
[*Example 1*: The sequence `$1,056.23` in a common United States locale
|
| 2089 |
would yield, for `units`, `105623`, or, for `digits`,
|
| 2090 |
`"105623"`. — *end example*]
|
| 2091 |
|
|
@@ -2126,11 +2126,11 @@ the result is given a positive sign.
|
|
| 2126 |
|
| 2127 |
Digits in the numeric monetary component are extracted and placed in
|
| 2128 |
`digits`, or into a character buffer `buf1` for conversion to produce a
|
| 2129 |
value for `units`, in the order in which they appear, preceded by a
|
| 2130 |
minus sign if and only if the result is negative. The value `units` is
|
| 2131 |
-
produced as if by[^
|
| 2132 |
|
| 2133 |
``` cpp
|
| 2134 |
for (int i = 0; i < n; ++i)
|
| 2135 |
buf2[i] = src[find(atoms, atoms + sizeof(src), buf1[i]) - atoms];
|
| 2136 |
buf2[n] = 0;
|
|
@@ -2147,11 +2147,13 @@ ct.widen(src, src + sizeof(src) - 1, atoms);
|
|
| 2147 |
```
|
| 2148 |
|
| 2149 |
*Returns:* An iterator pointing immediately beyond the last character
|
| 2150 |
recognized as part of a valid monetary quantity.
|
| 2151 |
|
| 2152 |
-
#### Class template `money_put` <a id="locale.money.put">[[locale.money.put]]</a>
|
|
|
|
|
|
|
| 2153 |
|
| 2154 |
``` cpp
|
| 2155 |
namespace std {
|
| 2156 |
template<class charT, class OutputIterator = ostreambuf_iterator<charT>>
|
| 2157 |
class money_put : public locale::facet {
|
|
@@ -2177,20 +2179,20 @@ namespace std {
|
|
| 2177 |
const string_type& digits) const;
|
| 2178 |
};
|
| 2179 |
}
|
| 2180 |
```
|
| 2181 |
|
| 2182 |
-
##### Members <a id="locale.money.put.members">[[locale.money.put.members]]</a>
|
| 2183 |
|
| 2184 |
``` cpp
|
| 2185 |
iter_type put(iter_type s, bool intl, ios_base& f, char_type fill, long double quant) const;
|
| 2186 |
iter_type put(iter_type s, bool intl, ios_base& f, char_type fill, const string_type& quant) const;
|
| 2187 |
```
|
| 2188 |
|
| 2189 |
-
*Returns:* `do_put(s, intl, f,
|
| 2190 |
|
| 2191 |
-
##### Virtual functions <a id="locale.money.put.virtuals">[[locale.money.put.virtuals]]</a>
|
| 2192 |
|
| 2193 |
``` cpp
|
| 2194 |
iter_type do_put(iter_type s, bool intl, ios_base& str,
|
| 2195 |
char_type fill, long double units) const;
|
| 2196 |
iter_type do_put(iter_type s, bool intl, ios_base& str,
|
|
@@ -2235,13 +2237,13 @@ before the other characters.
|
|
| 2235 |
|
| 2236 |
[*Note 1*: It is possible, with some combinations of format patterns
|
| 2237 |
and flag values, to produce output that cannot be parsed using
|
| 2238 |
`num_get<>::get`. — *end note*]
|
| 2239 |
|
| 2240 |
-
#### Class template `moneypunct` <a id="locale.moneypunct">[[locale.moneypunct]]</a>
|
| 2241 |
|
| 2242 |
-
##### General <a id="locale.moneypunct.general">[[locale.moneypunct.general]]</a>
|
| 2243 |
|
| 2244 |
``` cpp
|
| 2245 |
namespace std {
|
| 2246 |
class money_base {
|
| 2247 |
public:
|
|
@@ -2287,11 +2289,11 @@ namespace std {
|
|
| 2287 |
|
| 2288 |
The `moneypunct<>` facet defines monetary formatting parameters used by
|
| 2289 |
`money_get<>` and `money_put<>`. A monetary format is a sequence of four
|
| 2290 |
components, specified by a `pattern` value `p`, such that the `part`
|
| 2291 |
value `static_cast<part>(p.field[i])` determines the `i`ᵗʰ component of
|
| 2292 |
-
the format[^
|
| 2293 |
|
| 2294 |
In the `field` member of a `pattern` object, each value `symbol`,
|
| 2295 |
`sign`, `value`, and either `space` or `none` appears exactly once. The
|
| 2296 |
value `none`, if present, is not first; the value `space`, if present,
|
| 2297 |
is neither first nor last.
|
|
@@ -2354,11 +2356,11 @@ by `frac_digits()`.
|
|
| 2354 |
|
| 2355 |
The placement of thousands-separator characters (if any) is determined
|
| 2356 |
by the value returned by `grouping()`, defined identically as the member
|
| 2357 |
`numpunct<>::do_grouping()`.
|
| 2358 |
|
| 2359 |
-
##### Members <a id="locale.moneypunct.members">[[locale.moneypunct.members]]</a>
|
| 2360 |
|
| 2361 |
``` cpp
|
| 2362 |
charT decimal_point() const;
|
| 2363 |
charT thousands_sep() const;
|
| 2364 |
string grouping() const;
|
|
@@ -2371,60 +2373,60 @@ pattern neg_format() const;
|
|
| 2371 |
```
|
| 2372 |
|
| 2373 |
Each of these functions `F` returns the result of calling the
|
| 2374 |
corresponding virtual member function `do_F()`.
|
| 2375 |
|
| 2376 |
-
##### Virtual functions <a id="locale.moneypunct.virtuals">[[locale.moneypunct.virtuals]]</a>
|
| 2377 |
|
| 2378 |
``` cpp
|
| 2379 |
charT do_decimal_point() const;
|
| 2380 |
```
|
| 2381 |
|
| 2382 |
*Returns:* The radix separator to use in case `do_frac_digits()` is
|
| 2383 |
-
greater than zero.[^
|
| 2384 |
|
| 2385 |
``` cpp
|
| 2386 |
charT do_thousands_sep() const;
|
| 2387 |
```
|
| 2388 |
|
| 2389 |
*Returns:* The digit group separator to use in case `do_grouping()`
|
| 2390 |
-
specifies a digit grouping pattern.[^
|
| 2391 |
|
| 2392 |
``` cpp
|
| 2393 |
string do_grouping() const;
|
| 2394 |
```
|
| 2395 |
|
| 2396 |
*Returns:* A pattern defined identically as, but not necessarily equal
|
| 2397 |
-
to, the result of `numpunct<charT>::do_grouping()`.[^
|
| 2398 |
|
| 2399 |
``` cpp
|
| 2400 |
string_type do_curr_symbol() const;
|
| 2401 |
```
|
| 2402 |
|
| 2403 |
*Returns:* A string to use as the currency identifier symbol.
|
| 2404 |
|
| 2405 |
-
[*Note
|
| 2406 |
`true`, this is typically four characters long: a three-letter code as
|
| 2407 |
specified by ISO 4217 followed by a space. — *end note*]
|
| 2408 |
|
| 2409 |
``` cpp
|
| 2410 |
string_type do_positive_sign() const;
|
| 2411 |
string_type do_negative_sign() const;
|
| 2412 |
```
|
| 2413 |
|
| 2414 |
*Returns:* `do_positive_sign()` returns the string to use to indicate a
|
| 2415 |
-
positive monetary value;[^
|
| 2416 |
|
| 2417 |
`do_negative_sign()` returns the string to use to indicate a negative
|
| 2418 |
value.
|
| 2419 |
|
| 2420 |
``` cpp
|
| 2421 |
int do_frac_digits() const;
|
| 2422 |
```
|
| 2423 |
|
| 2424 |
*Returns:* The number of digits after the decimal radix separator, if
|
| 2425 |
-
any.[^
|
| 2426 |
|
| 2427 |
``` cpp
|
| 2428 |
pattern do_pos_format() const;
|
| 2429 |
pattern do_neg_format() const;
|
| 2430 |
```
|
|
@@ -2436,13 +2438,13 @@ pattern do_neg_format() const;
|
|
| 2436 |
- `moneypunct<wchar_t>`,
|
| 2437 |
- `moneypunct<char, true>`, and
|
| 2438 |
- `moneypunct<wchar_t, true>`,
|
| 2439 |
|
| 2440 |
return an object of type `pattern` initialized to
|
| 2441 |
-
`{ symbol, sign, none, value }`.[^
|
| 2442 |
|
| 2443 |
-
#### Class template `moneypunct_byname` <a id="locale.moneypunct.byname">[[locale.moneypunct.byname]]</a>
|
| 2444 |
|
| 2445 |
``` cpp
|
| 2446 |
namespace std {
|
| 2447 |
template<class charT, bool Intl = false>
|
| 2448 |
class moneypunct_byname : public moneypunct<charT, Intl> {
|
|
@@ -2457,20 +2459,20 @@ namespace std {
|
|
| 2457 |
~moneypunct_byname();
|
| 2458 |
};
|
| 2459 |
}
|
| 2460 |
```
|
| 2461 |
|
| 2462 |
-
### The message retrieval category <a id="category.messages">[[category.messages]]</a>
|
| 2463 |
|
| 2464 |
-
#### General <a id="category.messages.general">[[category.messages.general]]</a>
|
| 2465 |
|
| 2466 |
Class `messages<charT>` implements retrieval of strings from message
|
| 2467 |
catalogs.
|
| 2468 |
|
| 2469 |
-
#### Class template `messages` <a id="locale.messages">[[locale.messages]]</a>
|
| 2470 |
|
| 2471 |
-
##### General <a id="locale.messages.general">[[locale.messages.general]]</a>
|
| 2472 |
|
| 2473 |
``` cpp
|
| 2474 |
namespace std {
|
| 2475 |
class messages_base {
|
| 2476 |
public:
|
|
@@ -2503,11 +2505,11 @@ namespace std {
|
|
| 2503 |
```
|
| 2504 |
|
| 2505 |
Values of type `messages_base::catalog` usable as arguments to members
|
| 2506 |
`get` and `close` can be obtained only by calling member `open`.
|
| 2507 |
|
| 2508 |
-
##### Members <a id="locale.messages.members">[[locale.messages.members]]</a>
|
| 2509 |
|
| 2510 |
``` cpp
|
| 2511 |
catalog open(const string& name, const locale& loc) const;
|
| 2512 |
```
|
| 2513 |
|
|
@@ -2523,11 +2525,11 @@ string_type get(catalog cat, int set, int msgid, const string_type& dfault) cons
|
|
| 2523 |
void close(catalog cat) const;
|
| 2524 |
```
|
| 2525 |
|
| 2526 |
*Effects:* Calls `do_close(cat)`.
|
| 2527 |
|
| 2528 |
-
##### Virtual functions <a id="locale.messages.virtuals">[[locale.messages.virtuals]]</a>
|
| 2529 |
|
| 2530 |
``` cpp
|
| 2531 |
catalog do_open(const string& name, const locale& loc) const;
|
| 2532 |
```
|
| 2533 |
|
|
@@ -2562,11 +2564,11 @@ closed.
|
|
| 2562 |
*Effects:* Releases unspecified resources associated with `cat`.
|
| 2563 |
|
| 2564 |
*Remarks:* The limit on such resources, if any, is
|
| 2565 |
*implementation-defined*.
|
| 2566 |
|
| 2567 |
-
#### Class template `messages_byname` <a id="locale.messages.byname">[[locale.messages.byname]]</a>
|
| 2568 |
|
| 2569 |
``` cpp
|
| 2570 |
namespace std {
|
| 2571 |
template<class charT>
|
| 2572 |
class messages_byname : public messages<charT> {
|
|
|
|
| 1 |
+
### Standard `locale` categories <a id="locale.categories">[[locale.categories]]</a>
|
| 2 |
|
| 3 |
+
#### General <a id="locale.categories.general">[[locale.categories.general]]</a>
|
| 4 |
|
| 5 |
Each of the standard categories includes a family of facets. Some of
|
| 6 |
these implement formatting or parsing of a datum, for use by standard or
|
| 7 |
users’ iostream operators `<<` and `>>`, as members `put()` and `get()`,
|
| 8 |
respectively. Each such member function takes an `ios_base&` argument
|
|
|
|
| 16 |
of the OutputIterator argument can be extracted from the returned
|
| 17 |
iterator.) The `get()` members take an `ios_base::iostate&` argument
|
| 18 |
whose value they ignore, but set to `ios_base::failbit` in case of a
|
| 19 |
parse error.
|
| 20 |
|
| 21 |
+
Within [[locale.categories]] it is unspecified whether one virtual
|
| 22 |
+
function calls another virtual function.
|
| 23 |
|
| 24 |
+
#### The `ctype` category <a id="category.ctype">[[category.ctype]]</a>
|
| 25 |
|
| 26 |
+
##### General <a id="category.ctype.general">[[category.ctype.general]]</a>
|
| 27 |
|
| 28 |
``` cpp
|
| 29 |
namespace std {
|
| 30 |
class ctype_base {
|
| 31 |
public:
|
| 32 |
using mask = see below;
|
| 33 |
|
| 34 |
// numeric values are for exposition only.
|
| 35 |
+
static constexpr mask space = 1 << 0;
|
| 36 |
+
static constexpr mask print = 1 << 1;
|
| 37 |
+
static constexpr mask cntrl = 1 << 2;
|
| 38 |
+
static constexpr mask upper = 1 << 3;
|
| 39 |
+
static constexpr mask lower = 1 << 4;
|
| 40 |
+
static constexpr mask alpha = 1 << 5;
|
| 41 |
+
static constexpr mask digit = 1 << 6;
|
| 42 |
+
static constexpr mask punct = 1 << 7;
|
| 43 |
+
static constexpr mask xdigit = 1 << 8;
|
| 44 |
+
static constexpr mask blank = 1 << 9;
|
| 45 |
+
static constexpr mask alnum = alpha | digit;
|
| 46 |
+
static constexpr mask graph = alnum | punct;
|
| 47 |
};
|
| 48 |
}
|
| 49 |
```
|
| 50 |
|
| 51 |
The type `mask` is a bitmask type [[bitmask.types]].
|
| 52 |
|
| 53 |
+
##### Class template `ctype` <a id="locale.ctype">[[locale.ctype]]</a>
|
| 54 |
|
| 55 |
+
###### General <a id="locale.ctype.general">[[locale.ctype.general]]</a>
|
| 56 |
|
| 57 |
``` cpp
|
| 58 |
namespace std {
|
| 59 |
template<class charT>
|
| 60 |
class ctype : public locale::facet, public ctype_base {
|
|
|
|
| 105 |
The specializations required in [[locale.category.facets]]
|
| 106 |
[[locale.category]], namely `ctype<char>` and `ctype<wchar_t>`,
|
| 107 |
implement character classing appropriate to the implementation’s native
|
| 108 |
character set.
|
| 109 |
|
| 110 |
+
###### `ctype` members <a id="locale.ctype.members">[[locale.ctype.members]]</a>
|
| 111 |
|
| 112 |
``` cpp
|
| 113 |
bool is(mask m, charT c) const;
|
| 114 |
const charT* is(const charT* low, const charT* high, mask* vec) const;
|
| 115 |
```
|
|
|
|
| 127 |
```
|
| 128 |
|
| 129 |
*Returns:* `do_scan_not(m, low, high)`.
|
| 130 |
|
| 131 |
``` cpp
|
| 132 |
+
charT toupper(charT c) const;
|
| 133 |
const charT* toupper(charT* low, const charT* high) const;
|
| 134 |
```
|
| 135 |
|
| 136 |
*Returns:* `do_toupper(c)` or `do_toupper(low, high)`.
|
| 137 |
|
|
|
|
| 154 |
const charT* narrow(const charT* low, const charT* high, char dfault, char* to) const;
|
| 155 |
```
|
| 156 |
|
| 157 |
*Returns:* `do_narrow(c, dfault)` or `do_narrow(low, high, dfault, to)`.
|
| 158 |
|
| 159 |
+
###### `ctype` virtual functions <a id="locale.ctype.virtuals">[[locale.ctype.virtuals]]</a>
|
| 160 |
|
| 161 |
``` cpp
|
| 162 |
bool do_is(mask m, charT c) const;
|
| 163 |
const charT* do_is(const charT* low, const charT* high, mask* vec) const;
|
| 164 |
```
|
|
|
|
| 230 |
values.[^5]
|
| 231 |
|
| 232 |
The only characters for which unique transformations are required are
|
| 233 |
those in the basic character set [[lex.charset]].
|
| 234 |
|
| 235 |
+
For any named `ctype` category with a `ctype<char>` facet `ctc` and
|
| 236 |
valid `ctype_base::mask` value `M`,
|
| 237 |
`(ctc.is(M, c) || !is(M, do_widen(c)) )` is `true`.[^6]
|
| 238 |
|
| 239 |
The second form transforms each character `*p` in the range \[`low`,
|
| 240 |
`high`), placing the result in `dest[p - low]`.
|
|
|
|
| 273 |
available) in `dest[p - low]`.
|
| 274 |
|
| 275 |
*Returns:* The first form returns the transformed value; or `dfault` if
|
| 276 |
no mapping is readily available. The second form returns `high`.
|
| 277 |
|
| 278 |
+
##### Class template `ctype_byname` <a id="locale.ctype.byname">[[locale.ctype.byname]]</a>
|
| 279 |
|
| 280 |
``` cpp
|
| 281 |
namespace std {
|
| 282 |
template<class charT>
|
| 283 |
class ctype_byname : public ctype<charT> {
|
| 284 |
public:
|
| 285 |
+
using mask = ctype<charT>::mask;
|
| 286 |
explicit ctype_byname(const char*, size_t refs = 0);
|
| 287 |
explicit ctype_byname(const string&, size_t refs = 0);
|
| 288 |
|
| 289 |
protected:
|
| 290 |
~ctype_byname();
|
| 291 |
};
|
| 292 |
}
|
| 293 |
```
|
| 294 |
|
| 295 |
+
##### `ctype<char>` specialization <a id="facet.ctype.special">[[facet.ctype.special]]</a>
|
| 296 |
|
| 297 |
+
###### General <a id="facet.ctype.special.general">[[facet.ctype.special.general]]</a>
|
| 298 |
|
| 299 |
``` cpp
|
| 300 |
namespace std {
|
| 301 |
template<>
|
| 302 |
class ctype<char> : public locale::facet, public ctype_base {
|
|
|
|
| 346 |
on type `char` can be implemented inline.[^7]
|
| 347 |
|
| 348 |
The *implementation-defined* value of member `table_size` is at least
|
| 349 |
256.
|
| 350 |
|
| 351 |
+
###### Destructor <a id="facet.ctype.char.dtor">[[facet.ctype.char.dtor]]</a>
|
| 352 |
|
| 353 |
``` cpp
|
| 354 |
~ctype();
|
| 355 |
```
|
| 356 |
|
| 357 |
*Effects:* If the constructor’s first argument was nonzero, and its
|
| 358 |
second argument was `true`, does `delete [] table()`.
|
| 359 |
|
| 360 |
+
###### Members <a id="facet.ctype.char.members">[[facet.ctype.char.members]]</a>
|
| 361 |
|
| 362 |
In the following member descriptions, for `unsigned char` values `v`
|
| 363 |
where `v >= table_size`, `table()[v]` is assumed to have an
|
| 364 |
implementation-specific value (possibly different for each such value
|
| 365 |
`v`) without performing the array lookup.
|
|
|
|
| 442 |
```
|
| 443 |
|
| 444 |
*Returns:* The first constructor argument, if it was nonzero, otherwise
|
| 445 |
`classic_table()`.
|
| 446 |
|
| 447 |
+
###### Static members <a id="facet.ctype.char.statics">[[facet.ctype.char.statics]]</a>
|
| 448 |
|
| 449 |
``` cpp
|
| 450 |
static const mask* classic_table() noexcept;
|
| 451 |
```
|
| 452 |
|
| 453 |
*Returns:* A pointer to the initial element of an array of size
|
| 454 |
`table_size` which represents the classifications of characters in the
|
| 455 |
`"C"` locale.
|
| 456 |
|
| 457 |
+
###### Virtual functions <a id="facet.ctype.char.virtuals">[[facet.ctype.char.virtuals]]</a>
|
| 458 |
|
| 459 |
``` cpp
|
| 460 |
char do_toupper(char) const;
|
| 461 |
const char* do_toupper(char* low, const char* high) const;
|
| 462 |
char do_tolower(char) const;
|
|
|
|
| 470 |
```
|
| 471 |
|
| 472 |
These functions are described identically as those members of the same
|
| 473 |
name in the `ctype` class template [[locale.ctype.members]].
|
| 474 |
|
| 475 |
+
##### Class template `codecvt` <a id="locale.codecvt">[[locale.codecvt]]</a>
|
| 476 |
|
| 477 |
+
###### General <a id="locale.codecvt.general">[[locale.codecvt.general]]</a>
|
| 478 |
|
| 479 |
``` cpp
|
| 480 |
namespace std {
|
| 481 |
class codecvt_base {
|
| 482 |
public:
|
|
|
|
| 544 |
mapped between.
|
| 545 |
|
| 546 |
The specializations required in [[locale.category.facets]]
|
| 547 |
[[locale.category]] convert the implementation-defined native character
|
| 548 |
set. `codecvt<char, char, mbstate_t>` implements a degenerate
|
| 549 |
+
conversion; it does not convert at all.
|
| 550 |
+
`codecvt<wchar_t, char, mbstate_t>` converts between the native
|
| 551 |
+
character sets for ordinary and wide characters. Specializations on
|
| 552 |
+
`mbstate_t` perform conversion between encodings known to the library
|
| 553 |
+
implementer. Other encodings can be converted by specializing on a
|
| 554 |
+
program-defined `stateT` type. Objects of type `stateT` can contain any
|
| 555 |
+
state that is useful to communicate to or from the specialized `do_in`
|
| 556 |
+
or `do_out` members.
|
|
|
|
|
|
|
|
|
|
| 557 |
|
| 558 |
+
###### Members <a id="locale.codecvt.members">[[locale.codecvt.members]]</a>
|
| 559 |
|
| 560 |
``` cpp
|
| 561 |
result out(
|
| 562 |
stateT& state,
|
| 563 |
const internT* from, const internT* from_end, const internT*& from_next,
|
|
|
|
| 605 |
int max_length() const noexcept;
|
| 606 |
```
|
| 607 |
|
| 608 |
*Returns:* `do_max_length()`.
|
| 609 |
|
| 610 |
+
###### Virtual functions <a id="locale.codecvt.virtuals">[[locale.codecvt.virtuals]]</a>
|
| 611 |
|
| 612 |
``` cpp
|
| 613 |
result do_out(
|
| 614 |
stateT& state,
|
| 615 |
const internT* from, const internT* from_end, const internT*& from_next,
|
|
|
|
| 631 |
destination `to`. Converts no more than `(from_end - from)` source
|
| 632 |
elements, and stores no more than `(to_end - to)` destination elements.
|
| 633 |
|
| 634 |
Stops if it encounters a character it cannot convert. It always leaves
|
| 635 |
the `from_next` and `to_next` pointers pointing one beyond the last
|
| 636 |
+
element successfully converted. If it returns `noconv`, `internT` and
|
| 637 |
+
`externT` are the same type, and the converted sequence is identical to
|
| 638 |
+
the input sequence \[`from`, `from``next`), `to_next` is set equal to
|
| 639 |
`to`, the value of `state` is unchanged, and there are no changes to the
|
| 640 |
values in \[`to`, `to_end`).
|
| 641 |
|
| 642 |
A `codecvt` facet that is used by `basic_filebuf` [[file.streams]] shall
|
| 643 |
have the property that if
|
|
|
|
| 748 |
|
| 749 |
*Effects:* The effect on the `state` argument is as if it called
|
| 750 |
`do_in(state, from, from_end, from, to, to + max, to)` for `to` pointing
|
| 751 |
to a buffer of at least `max` elements.
|
| 752 |
|
| 753 |
+
*Returns:* `(from_next - from)` where `from_next` is the largest value
|
| 754 |
+
in the range \[`from`, `from_end`\] such that the sequence of values in
|
| 755 |
+
the range \[`from`, `from_next`) represents `max` or fewer valid
|
| 756 |
+
complete characters of type `internT`. The specialization
|
| 757 |
`codecvt<char, char, mbstate_t>`, returns the lesser of `max` and
|
| 758 |
`(from_end - from)`.
|
| 759 |
|
| 760 |
``` cpp
|
| 761 |
int do_max_length() const noexcept;
|
|
|
|
| 764 |
*Returns:* The maximum value that `do_length(state, from, from_end, 1)`
|
| 765 |
can return for any valid range \[`from`, `from_end`) and `stateT` value
|
| 766 |
`state`. The specialization
|
| 767 |
`codecvt<char, char, mbstate_t>::do_max_length()` returns 1.
|
| 768 |
|
| 769 |
+
##### Class template `codecvt_byname` <a id="locale.codecvt.byname">[[locale.codecvt.byname]]</a>
|
| 770 |
|
| 771 |
``` cpp
|
| 772 |
namespace std {
|
| 773 |
template<class internT, class externT, class stateT>
|
| 774 |
class codecvt_byname : public codecvt<internT, externT, stateT> {
|
|
|
|
| 780 |
~codecvt_byname();
|
| 781 |
};
|
| 782 |
}
|
| 783 |
```
|
| 784 |
|
| 785 |
+
#### The numeric category <a id="category.numeric">[[category.numeric]]</a>
|
| 786 |
|
| 787 |
+
##### General <a id="category.numeric.general">[[category.numeric.general]]</a>
|
| 788 |
|
| 789 |
The classes `num_get<>` and `num_put<>` handle numeric formatting and
|
| 790 |
parsing. Virtual functions are provided for several numeric types.
|
| 791 |
Implementations may (but are not required to) delegate extraction of
|
| 792 |
smaller types to extractors for larger types.[^11]
|
|
|
|
| 804 |
|
| 805 |
Extractor and inserter members of the standard iostreams use `num_get<>`
|
| 806 |
and `num_put<>` member functions for formatting and parsing numeric
|
| 807 |
values [[istream.formatted.reqmts]], [[ostream.formatted.reqmts]].
|
| 808 |
|
| 809 |
+
##### Class template `num_get` <a id="locale.num.get">[[locale.num.get]]</a>
|
| 810 |
|
| 811 |
+
###### General <a id="locale.num.get.general">[[locale.num.get.general]]</a>
|
| 812 |
|
| 813 |
``` cpp
|
| 814 |
namespace std {
|
| 815 |
template<class charT, class InputIterator = istreambuf_iterator<charT>>
|
| 816 |
class num_get : public locale::facet {
|
|
|
|
| 874 |
```
|
| 875 |
|
| 876 |
The facet `num_get` is used to parse numeric values from an input
|
| 877 |
sequence such as an istream.
|
| 878 |
|
| 879 |
+
###### Members <a id="facet.num.get.members">[[facet.num.get.members]]</a>
|
| 880 |
|
| 881 |
``` cpp
|
| 882 |
iter_type get(iter_type in, iter_type end, ios_base& str,
|
| 883 |
ios_base::iostate& err, bool& val) const;
|
| 884 |
iter_type get(iter_type in, iter_type end, ios_base& str,
|
|
|
|
| 903 |
ios_base::iostate& err, void*& val) const;
|
| 904 |
```
|
| 905 |
|
| 906 |
*Returns:* `do_get(in, end, str, err, val)`.
|
| 907 |
|
| 908 |
+
###### Virtual functions <a id="facet.num.get.virtuals">[[facet.num.get.virtuals]]</a>
|
| 909 |
|
| 910 |
``` cpp
|
| 911 |
iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
| 912 |
ios_base::iostate& err, long& val) const;
|
| 913 |
iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
|
|
|
| 932 |
|
| 933 |
*Effects:* Reads characters from `in`, interpreting them according to
|
| 934 |
`str.flags()`, `use_facet<ctype<charT>>(loc)`, and
|
| 935 |
`use_facet<numpunct<charT>>(loc)`, where `loc` is `str.getloc()`.
|
| 936 |
|
| 937 |
+
The details of this operation occur in three stages:
|
| 938 |
|
| 939 |
+
- Stage 1: Determine a conversion specifier.
|
| 940 |
- Stage 2: Extract characters from `in` and determine a corresponding
|
| 941 |
`char` value for the format expected by the conversion specification
|
| 942 |
determined in stage 1.
|
| 943 |
+
- Stage 3: Store results.
|
| 944 |
|
| 945 |
The details of the stages are presented below.
|
| 946 |
|
| 947 |
[*Example 1*:
|
| 948 |
|
|
|
|
| 992 |
|
| 993 |
The `in` iterator is always left pointing one position beyond the last
|
| 994 |
character successfully matched. If `val` is set, then `err` is set to
|
| 995 |
`str.goodbit`; or to `str.eofbit` if, when seeking another character to
|
| 996 |
match, it is found that `(in == end)`. If `val` is not set, then `err`
|
| 997 |
+
is set to `str.failbit`; or to `(str.failbit | str.eofbit)` if the
|
| 998 |
+
reason for the failure was that `(in == end)`.
|
| 999 |
|
| 1000 |
[*Example 2*: For targets `true`: `"a"` and `false`: `"abb"`, the input
|
| 1001 |
sequence `"a"` yields `val == true` and `err == str.eofbit`; the input
|
| 1002 |
sequence `"abc"` yields `err = str.failbit`, with `in` ending at the
|
| 1003 |
`’c’` element. For targets `true`: `"1"` and `false`: `"0"`, the input
|
|
|
|
| 1005 |
targets `("")`, any input sequence yields
|
| 1006 |
`err == str.failbit`. — *end example*]
|
| 1007 |
|
| 1008 |
*Returns:* `in`.
|
| 1009 |
|
| 1010 |
+
##### Class template `num_put` <a id="locale.nm.put">[[locale.nm.put]]</a>
|
| 1011 |
|
| 1012 |
+
###### General <a id="locale.nm.put.general">[[locale.nm.put.general]]</a>
|
| 1013 |
|
| 1014 |
``` cpp
|
| 1015 |
namespace std {
|
| 1016 |
template<class charT, class OutputIterator = ostreambuf_iterator<charT>>
|
| 1017 |
class num_put : public locale::facet {
|
|
|
|
| 1047 |
```
|
| 1048 |
|
| 1049 |
The facet `num_put` is used to format numeric values to a character
|
| 1050 |
sequence such as an ostream.
|
| 1051 |
|
| 1052 |
+
###### Members <a id="facet.num.put.members">[[facet.num.put.members]]</a>
|
| 1053 |
|
| 1054 |
``` cpp
|
| 1055 |
iter_type put(iter_type out, ios_base& str, char_type fill, bool val) const;
|
| 1056 |
iter_type put(iter_type out, ios_base& str, char_type fill, long val) const;
|
| 1057 |
iter_type put(iter_type out, ios_base& str, char_type fill, long long val) const;
|
|
|
|
| 1062 |
iter_type put(iter_type out, ios_base& str, char_type fill, const void* val) const;
|
| 1063 |
```
|
| 1064 |
|
| 1065 |
*Returns:* `do_put(out, str, fill, val)`.
|
| 1066 |
|
| 1067 |
+
###### Virtual functions <a id="facet.num.put.virtuals">[[facet.num.put.virtuals]]</a>
|
| 1068 |
|
| 1069 |
``` cpp
|
| 1070 |
iter_type do_put(iter_type out, ios_base& str, char_type fill, long val) const;
|
| 1071 |
iter_type do_put(iter_type out, ios_base& str, char_type fill, long long val) const;
|
| 1072 |
iter_type do_put(iter_type out, ios_base& str, char_type fill, unsigned long val) const;
|
|
|
|
| 1145 |
|
| 1146 |
**Table: Floating-point conversions** <a id="facet.num.put.fp">[facet.num.put.fp]</a>
|
| 1147 |
|
| 1148 |
| State | `stdio` equivalent |
|
| 1149 |
| ---------------------------------------------------------------------- | ------------------ |
|
| 1150 |
+
| `floatfield == ios_base::fixed && !uppercase` | `%f` |
|
| 1151 |
+
| `floatfield == ios_base::fixed` | `%F` |
|
| 1152 |
| `floatfield == ios_base::scientific && !uppercase` | `%e` |
|
| 1153 |
| `floatfield == ios_base::scientific` | `%E` |
|
| 1154 |
| `floatfield == (ios_base::fixed | ios_base::scientific) && !uppercase` | `%a` |
|
| 1155 |
| `floatfield == (ios_base::fixed | ios_base::scientific)` | `%A` |
|
| 1156 |
| `!uppercase` | `%g` |
|
|
|
|
| 1272 |
```
|
| 1273 |
|
| 1274 |
and then inserts each character `c` of `s` into `out` via `*out++ = c`
|
| 1275 |
and returns `out`.
|
| 1276 |
|
| 1277 |
+
#### The numeric punctuation facet <a id="facet.numpunct">[[facet.numpunct]]</a>
|
| 1278 |
|
| 1279 |
+
##### Class template `numpunct` <a id="locale.numpunct">[[locale.numpunct]]</a>
|
| 1280 |
|
| 1281 |
+
###### General <a id="locale.numpunct.general">[[locale.numpunct.general]]</a>
|
| 1282 |
|
| 1283 |
``` cpp
|
| 1284 |
namespace std {
|
| 1285 |
template<class charT>
|
| 1286 |
class numpunct : public locale::facet {
|
|
|
|
| 1369 |
|
| 1370 |
where the number of digits between is as specified by `do_grouping()`.
|
| 1371 |
For parsing, if the portion contains no thousands-separators, no
|
| 1372 |
grouping constraint is applied.
|
| 1373 |
|
| 1374 |
+
###### Members <a id="facet.numpunct.members">[[facet.numpunct.members]]</a>
|
| 1375 |
|
| 1376 |
``` cpp
|
| 1377 |
char_type decimal_point() const;
|
| 1378 |
```
|
| 1379 |
|
|
|
|
| 1396 |
string_type falsename() const;
|
| 1397 |
```
|
| 1398 |
|
| 1399 |
*Returns:* `do_truename()` or `do_falsename()`, respectively.
|
| 1400 |
|
| 1401 |
+
###### Virtual functions <a id="facet.numpunct.virtuals">[[facet.numpunct.virtuals]]</a>
|
| 1402 |
|
| 1403 |
``` cpp
|
| 1404 |
char_type do_decimal_point() const;
|
| 1405 |
```
|
| 1406 |
|
|
|
|
| 1438 |
`false`, respectively.
|
| 1439 |
|
| 1440 |
In the base class implementation these names are `"true"` and `"false"`,
|
| 1441 |
or `L"true"` and `L"false"`.
|
| 1442 |
|
| 1443 |
+
##### Class template `numpunct_byname` <a id="locale.numpunct.byname">[[locale.numpunct.byname]]</a>
|
| 1444 |
|
| 1445 |
``` cpp
|
| 1446 |
namespace std {
|
| 1447 |
template<class charT>
|
| 1448 |
class numpunct_byname : public numpunct<charT> {
|
|
|
|
| 1458 |
~numpunct_byname();
|
| 1459 |
};
|
| 1460 |
}
|
| 1461 |
```
|
| 1462 |
|
| 1463 |
+
#### The collate category <a id="category.collate">[[category.collate]]</a>
|
| 1464 |
|
| 1465 |
+
##### Class template `collate` <a id="locale.collate">[[locale.collate]]</a>
|
| 1466 |
|
| 1467 |
+
###### General <a id="locale.collate.general">[[locale.collate.general]]</a>
|
| 1468 |
|
| 1469 |
``` cpp
|
| 1470 |
namespace std {
|
| 1471 |
template<class charT>
|
| 1472 |
class collate : public locale::facet {
|
|
|
|
| 1503 |
[[alg.lex.comparison]].
|
| 1504 |
|
| 1505 |
Each function compares a string of characters `*p` in the range \[`low`,
|
| 1506 |
`high`).
|
| 1507 |
|
| 1508 |
+
###### Members <a id="locale.collate.members">[[locale.collate.members]]</a>
|
| 1509 |
|
| 1510 |
``` cpp
|
| 1511 |
int compare(const charT* low1, const charT* high1,
|
| 1512 |
const charT* low2, const charT* high2) const;
|
| 1513 |
```
|
|
|
|
| 1524 |
long hash(const charT* low, const charT* high) const;
|
| 1525 |
```
|
| 1526 |
|
| 1527 |
*Returns:* `do_hash(low, high)`.
|
| 1528 |
|
| 1529 |
+
###### Virtual functions <a id="locale.collate.virtuals">[[locale.collate.virtuals]]</a>
|
| 1530 |
|
| 1531 |
``` cpp
|
| 1532 |
int do_compare(const charT* low1, const charT* high1,
|
| 1533 |
const charT* low2, const charT* high2) const;
|
| 1534 |
```
|
|
|
|
| 1558 |
|
| 1559 |
*Recommended practice:* The probability that the result equals that for
|
| 1560 |
another string which does not compare equal should be very small,
|
| 1561 |
approaching `(1.0/numeric_limits<unsigned long>::max())`.
|
| 1562 |
|
| 1563 |
+
##### Class template `collate_byname` <a id="locale.collate.byname">[[locale.collate.byname]]</a>
|
| 1564 |
|
| 1565 |
``` cpp
|
| 1566 |
namespace std {
|
| 1567 |
template<class charT>
|
| 1568 |
class collate_byname : public collate<charT> {
|
|
|
|
| 1576 |
~collate_byname();
|
| 1577 |
};
|
| 1578 |
}
|
| 1579 |
```
|
| 1580 |
|
| 1581 |
+
#### The time category <a id="category.time">[[category.time]]</a>
|
| 1582 |
|
| 1583 |
+
##### General <a id="category.time.general">[[category.time.general]]</a>
|
| 1584 |
|
| 1585 |
Templates `time_get<charT, InputIterator>` and
|
| 1586 |
`time_put<charT, OutputIterator>` provide date and time formatting and
|
| 1587 |
parsing. All specifications of member functions for `time_put` and
|
| 1588 |
`time_get` in the subclauses of [[category.time]] only apply to the
|
|
|
|
| 1590 |
[[tab:locale.spec]] [[locale.category]]. Their members use their
|
| 1591 |
`ios_base&`, `ios_base::iostate&`, and `fill` arguments as described in
|
| 1592 |
[[locale.categories]], and the `ctype<>` facet, to determine formatting
|
| 1593 |
details.
|
| 1594 |
|
| 1595 |
+
##### Class template `time_get` <a id="locale.time.get">[[locale.time.get]]</a>
|
| 1596 |
|
| 1597 |
+
###### General <a id="locale.time.get.general">[[locale.time.get.general]]</a>
|
| 1598 |
|
| 1599 |
``` cpp
|
| 1600 |
namespace std {
|
| 1601 |
class time_base {
|
| 1602 |
public:
|
|
|
|
| 1658 |
are assigned.[^15]
|
| 1659 |
|
| 1660 |
If the end iterator is reached during parsing by any of the `get()`
|
| 1661 |
member functions, the member sets `ios_base::eofbit` in `err`.
|
| 1662 |
|
| 1663 |
+
###### Members <a id="locale.time.get.members">[[locale.time.get.members]]</a>
|
| 1664 |
|
| 1665 |
``` cpp
|
| 1666 |
dateorder date_order() const;
|
| 1667 |
```
|
| 1668 |
|
|
|
|
| 1751 |
whether multi-character sequences are considered while doing
|
| 1752 |
so. — *end note*]
|
| 1753 |
|
| 1754 |
*Returns:* `s`.
|
| 1755 |
|
| 1756 |
+
###### Virtual functions <a id="locale.time.get.virtuals">[[locale.time.get.virtuals]]</a>
|
| 1757 |
|
| 1758 |
``` cpp
|
| 1759 |
dateorder do_date_order() const;
|
| 1760 |
```
|
| 1761 |
|
|
|
|
| 1869 |
*Remarks:* It is unspecified whether multiple calls to `do_get()` with
|
| 1870 |
the address of the same `tm` object will update the current contents of
|
| 1871 |
the object or simply overwrite its members. Portable programs should
|
| 1872 |
zero out the object before invoking the function.
|
| 1873 |
|
| 1874 |
+
##### Class template `time_get_byname` <a id="locale.time.get.byname">[[locale.time.get.byname]]</a>
|
| 1875 |
|
| 1876 |
``` cpp
|
| 1877 |
namespace std {
|
| 1878 |
template<class charT, class InputIterator = istreambuf_iterator<charT>>
|
| 1879 |
class time_get_byname : public time_get<charT, InputIterator> {
|
|
|
|
| 1888 |
~time_get_byname();
|
| 1889 |
};
|
| 1890 |
}
|
| 1891 |
```
|
| 1892 |
|
| 1893 |
+
##### Class template `time_put` <a id="locale.time.put">[[locale.time.put]]</a>
|
| 1894 |
+
|
| 1895 |
+
###### General <a id="locale.time.put.general">[[locale.time.put.general]]</a>
|
| 1896 |
|
| 1897 |
``` cpp
|
| 1898 |
namespace std {
|
| 1899 |
template<class charT, class OutputIterator = ostreambuf_iterator<charT>>
|
| 1900 |
class time_put : public locale::facet {
|
|
|
|
| 1918 |
char format, char modifier) const;
|
| 1919 |
};
|
| 1920 |
}
|
| 1921 |
```
|
| 1922 |
|
| 1923 |
+
###### Members <a id="locale.time.put.members">[[locale.time.put.members]]</a>
|
| 1924 |
|
| 1925 |
``` cpp
|
| 1926 |
iter_type put(iter_type s, ios_base& str, char_type fill, const tm* t,
|
| 1927 |
const charT* pattern, const charT* pat_end) const;
|
| 1928 |
iter_type put(iter_type s, ios_base& str, char_type fill, const tm* t,
|
|
|
|
| 1937 |
interleaved in the output in the order in which they appear in the
|
| 1938 |
pattern. Format sequences are identified by converting each character
|
| 1939 |
`c` to a `char` value as if by `ct.narrow(c, 0)`, where `ct` is a
|
| 1940 |
reference to `ctype<charT>` obtained from `str.getloc()`. The first
|
| 1941 |
character of each sequence is equal to `’%’`, followed by an optional
|
| 1942 |
+
modifier character `mod` and a format specifier character `spec` as
|
| 1943 |
+
defined for the function `strftime`. If no modifier character is
|
| 1944 |
+
present, `mod` is zero. For each valid format sequence identified, calls
|
|
|
|
|
|
|
| 1945 |
`do_put(s, str, fill, t, spec, mod)`.
|
| 1946 |
|
| 1947 |
The second form calls `do_put(s, str, fill, t, format, modifier)`.
|
| 1948 |
|
| 1949 |
+
[*Note 2*: The `fill` argument can be used in the
|
| 1950 |
implementation-defined formats or by derivations. A space character is a
|
| 1951 |
reasonable default for this argument. — *end note*]
|
| 1952 |
|
| 1953 |
*Returns:* An iterator pointing immediately after the last character
|
| 1954 |
produced.
|
| 1955 |
|
| 1956 |
+
###### Virtual functions <a id="locale.time.put.virtuals">[[locale.time.put.virtuals]]</a>
|
| 1957 |
|
| 1958 |
``` cpp
|
| 1959 |
iter_type do_put(iter_type s, ios_base&, char_type fill, const tm* t,
|
| 1960 |
char format, char modifier) const;
|
| 1961 |
```
|
|
|
|
| 1966 |
format specifiers in the string argument to the standard library
|
| 1967 |
function `strftime()`, except that the sequence of characters produced
|
| 1968 |
for those specifiers that are described as depending on the C locale are
|
| 1969 |
instead *implementation-defined*.
|
| 1970 |
|
| 1971 |
+
[*Note 3*: Interpretation of the `modifier` argument is
|
| 1972 |
implementation-defined. — *end note*]
|
| 1973 |
|
| 1974 |
*Returns:* An iterator pointing immediately after the last character
|
| 1975 |
produced.
|
| 1976 |
|
| 1977 |
+
[*Note 4*: The `fill` argument can be used in the
|
| 1978 |
implementation-defined formats or by derivations. A space character is a
|
| 1979 |
reasonable default for this argument. — *end note*]
|
| 1980 |
|
| 1981 |
*Recommended practice:* Interpretation of the `modifier` should follow
|
| 1982 |
POSIX conventions. Implementations should refer to other standards such
|
| 1983 |
as POSIX for a specification of the character sequences produced for
|
| 1984 |
those specifiers described as depending on the C locale.
|
| 1985 |
|
| 1986 |
+
##### Class template `time_put_byname` <a id="locale.time.put.byname">[[locale.time.put.byname]]</a>
|
| 1987 |
|
| 1988 |
``` cpp
|
| 1989 |
namespace std {
|
| 1990 |
template<class charT, class OutputIterator = ostreambuf_iterator<charT>>
|
| 1991 |
class time_put_byname : public time_put<charT, OutputIterator> {
|
|
|
|
| 2000 |
~time_put_byname();
|
| 2001 |
};
|
| 2002 |
}
|
| 2003 |
```
|
| 2004 |
|
| 2005 |
+
#### The monetary category <a id="category.monetary">[[category.monetary]]</a>
|
| 2006 |
|
| 2007 |
+
##### General <a id="category.monetary.general">[[category.monetary.general]]</a>
|
| 2008 |
|
| 2009 |
These templates handle monetary formats. A template parameter indicates
|
| 2010 |
whether local or international monetary formats are to be used.
|
| 2011 |
|
| 2012 |
All specifications of member functions for `money_put` and `money_get`
|
|
|
|
| 2015 |
[[tab:locale.spec]] [[locale.category]]. Their members use their
|
| 2016 |
`ios_base&`, `ios_base::iostate&`, and `fill` arguments as described in
|
| 2017 |
[[locale.categories]], and the `moneypunct<>` and `ctype<>` facets, to
|
| 2018 |
determine formatting details.
|
| 2019 |
|
| 2020 |
+
##### Class template `money_get` <a id="locale.money.get">[[locale.money.get]]</a>
|
| 2021 |
+
|
| 2022 |
+
###### General <a id="locale.money.get.general">[[locale.money.get.general]]</a>
|
| 2023 |
|
| 2024 |
``` cpp
|
| 2025 |
namespace std {
|
| 2026 |
template<class charT, class InputIterator = istreambuf_iterator<charT>>
|
| 2027 |
class money_get : public locale::facet {
|
|
|
|
| 2049 |
ios_base::iostate& err, string_type& digits) const;
|
| 2050 |
};
|
| 2051 |
}
|
| 2052 |
```
|
| 2053 |
|
| 2054 |
+
###### Members <a id="locale.money.get.members">[[locale.money.get.members]]</a>
|
| 2055 |
|
| 2056 |
``` cpp
|
| 2057 |
iter_type get(iter_type s, iter_type end, bool intl, ios_base& f,
|
| 2058 |
ios_base::iostate& err, long double& quant) const;
|
| 2059 |
iter_type get(iter_type s, iter_type end, bool intl, ios_base& f,
|
| 2060 |
ios_base::iostate& err, string_type& quant) const;
|
| 2061 |
```
|
| 2062 |
|
| 2063 |
*Returns:* `do_get(s, end, intl, f, err, quant)`.
|
| 2064 |
|
| 2065 |
+
###### Virtual functions <a id="locale.money.get.virtuals">[[locale.money.get.virtuals]]</a>
|
| 2066 |
|
| 2067 |
``` cpp
|
| 2068 |
iter_type do_get(iter_type s, iter_type end, bool intl, ios_base& str,
|
| 2069 |
ios_base::iostate& err, long double& units) const;
|
| 2070 |
iter_type do_get(iter_type s, iter_type end, bool intl, ios_base& str,
|
|
|
|
| 2074 |
*Effects:* Reads characters from `s` to parse and construct a monetary
|
| 2075 |
value according to the format specified by a `moneypunct<charT, Intl>`
|
| 2076 |
facet reference `mp` and the character mapping specified by a
|
| 2077 |
`ctype<charT>` facet reference `ct` obtained from the locale returned by
|
| 2078 |
`str.getloc()`, and `str.flags()`. If a valid sequence is recognized,
|
| 2079 |
+
does not change `err`; otherwise, sets `err` to `(err | str.failbit)`,
|
| 2080 |
+
or `(err | str.failbit | str.eofbit)` if no more characters are
|
| 2081 |
+
available, and does not change `units` or `digits`. Uses the pattern
|
| 2082 |
+
returned by `mp.neg_format()` to parse all values. The result is
|
| 2083 |
+
returned as an integral value stored in `units` or as a sequence of
|
| 2084 |
+
digits possibly preceded by a minus sign (as produced by `ct.widen(c)`
|
| 2085 |
+
where `c` is `’-’` or in the range from `’0’` through `’9’` (inclusive))
|
| 2086 |
+
stored in `digits`.
|
| 2087 |
|
| 2088 |
[*Example 1*: The sequence `$1,056.23` in a common United States locale
|
| 2089 |
would yield, for `units`, `105623`, or, for `digits`,
|
| 2090 |
`"105623"`. — *end example*]
|
| 2091 |
|
|
|
|
| 2126 |
|
| 2127 |
Digits in the numeric monetary component are extracted and placed in
|
| 2128 |
`digits`, or into a character buffer `buf1` for conversion to produce a
|
| 2129 |
value for `units`, in the order in which they appear, preceded by a
|
| 2130 |
minus sign if and only if the result is negative. The value `units` is
|
| 2131 |
+
produced as if by[^17]
|
| 2132 |
|
| 2133 |
``` cpp
|
| 2134 |
for (int i = 0; i < n; ++i)
|
| 2135 |
buf2[i] = src[find(atoms, atoms + sizeof(src), buf1[i]) - atoms];
|
| 2136 |
buf2[n] = 0;
|
|
|
|
| 2147 |
```
|
| 2148 |
|
| 2149 |
*Returns:* An iterator pointing immediately beyond the last character
|
| 2150 |
recognized as part of a valid monetary quantity.
|
| 2151 |
|
| 2152 |
+
##### Class template `money_put` <a id="locale.money.put">[[locale.money.put]]</a>
|
| 2153 |
+
|
| 2154 |
+
###### General <a id="locale.money.put.general">[[locale.money.put.general]]</a>
|
| 2155 |
|
| 2156 |
``` cpp
|
| 2157 |
namespace std {
|
| 2158 |
template<class charT, class OutputIterator = ostreambuf_iterator<charT>>
|
| 2159 |
class money_put : public locale::facet {
|
|
|
|
| 2179 |
const string_type& digits) const;
|
| 2180 |
};
|
| 2181 |
}
|
| 2182 |
```
|
| 2183 |
|
| 2184 |
+
###### Members <a id="locale.money.put.members">[[locale.money.put.members]]</a>
|
| 2185 |
|
| 2186 |
``` cpp
|
| 2187 |
iter_type put(iter_type s, bool intl, ios_base& f, char_type fill, long double quant) const;
|
| 2188 |
iter_type put(iter_type s, bool intl, ios_base& f, char_type fill, const string_type& quant) const;
|
| 2189 |
```
|
| 2190 |
|
| 2191 |
+
*Returns:* `do_put(s, intl, f, fill, quant)`.
|
| 2192 |
|
| 2193 |
+
###### Virtual functions <a id="locale.money.put.virtuals">[[locale.money.put.virtuals]]</a>
|
| 2194 |
|
| 2195 |
``` cpp
|
| 2196 |
iter_type do_put(iter_type s, bool intl, ios_base& str,
|
| 2197 |
char_type fill, long double units) const;
|
| 2198 |
iter_type do_put(iter_type s, bool intl, ios_base& str,
|
|
|
|
| 2237 |
|
| 2238 |
[*Note 1*: It is possible, with some combinations of format patterns
|
| 2239 |
and flag values, to produce output that cannot be parsed using
|
| 2240 |
`num_get<>::get`. — *end note*]
|
| 2241 |
|
| 2242 |
+
##### Class template `moneypunct` <a id="locale.moneypunct">[[locale.moneypunct]]</a>
|
| 2243 |
|
| 2244 |
+
###### General <a id="locale.moneypunct.general">[[locale.moneypunct.general]]</a>
|
| 2245 |
|
| 2246 |
``` cpp
|
| 2247 |
namespace std {
|
| 2248 |
class money_base {
|
| 2249 |
public:
|
|
|
|
| 2289 |
|
| 2290 |
The `moneypunct<>` facet defines monetary formatting parameters used by
|
| 2291 |
`money_get<>` and `money_put<>`. A monetary format is a sequence of four
|
| 2292 |
components, specified by a `pattern` value `p`, such that the `part`
|
| 2293 |
value `static_cast<part>(p.field[i])` determines the `i`ᵗʰ component of
|
| 2294 |
+
the format.[^18]
|
| 2295 |
|
| 2296 |
In the `field` member of a `pattern` object, each value `symbol`,
|
| 2297 |
`sign`, `value`, and either `space` or `none` appears exactly once. The
|
| 2298 |
value `none`, if present, is not first; the value `space`, if present,
|
| 2299 |
is neither first nor last.
|
|
|
|
| 2356 |
|
| 2357 |
The placement of thousands-separator characters (if any) is determined
|
| 2358 |
by the value returned by `grouping()`, defined identically as the member
|
| 2359 |
`numpunct<>::do_grouping()`.
|
| 2360 |
|
| 2361 |
+
###### Members <a id="locale.moneypunct.members">[[locale.moneypunct.members]]</a>
|
| 2362 |
|
| 2363 |
``` cpp
|
| 2364 |
charT decimal_point() const;
|
| 2365 |
charT thousands_sep() const;
|
| 2366 |
string grouping() const;
|
|
|
|
| 2373 |
```
|
| 2374 |
|
| 2375 |
Each of these functions `F` returns the result of calling the
|
| 2376 |
corresponding virtual member function `do_F()`.
|
| 2377 |
|
| 2378 |
+
###### Virtual functions <a id="locale.moneypunct.virtuals">[[locale.moneypunct.virtuals]]</a>
|
| 2379 |
|
| 2380 |
``` cpp
|
| 2381 |
charT do_decimal_point() const;
|
| 2382 |
```
|
| 2383 |
|
| 2384 |
*Returns:* The radix separator to use in case `do_frac_digits()` is
|
| 2385 |
+
greater than zero.[^19]
|
| 2386 |
|
| 2387 |
``` cpp
|
| 2388 |
charT do_thousands_sep() const;
|
| 2389 |
```
|
| 2390 |
|
| 2391 |
*Returns:* The digit group separator to use in case `do_grouping()`
|
| 2392 |
+
specifies a digit grouping pattern.[^20]
|
| 2393 |
|
| 2394 |
``` cpp
|
| 2395 |
string do_grouping() const;
|
| 2396 |
```
|
| 2397 |
|
| 2398 |
*Returns:* A pattern defined identically as, but not necessarily equal
|
| 2399 |
+
to, the result of `numpunct<charT>::do_grouping()`.[^21]
|
| 2400 |
|
| 2401 |
``` cpp
|
| 2402 |
string_type do_curr_symbol() const;
|
| 2403 |
```
|
| 2404 |
|
| 2405 |
*Returns:* A string to use as the currency identifier symbol.
|
| 2406 |
|
| 2407 |
+
[*Note 2*: For specializations where the second template parameter is
|
| 2408 |
`true`, this is typically four characters long: a three-letter code as
|
| 2409 |
specified by ISO 4217 followed by a space. — *end note*]
|
| 2410 |
|
| 2411 |
``` cpp
|
| 2412 |
string_type do_positive_sign() const;
|
| 2413 |
string_type do_negative_sign() const;
|
| 2414 |
```
|
| 2415 |
|
| 2416 |
*Returns:* `do_positive_sign()` returns the string to use to indicate a
|
| 2417 |
+
positive monetary value;[^22]
|
| 2418 |
|
| 2419 |
`do_negative_sign()` returns the string to use to indicate a negative
|
| 2420 |
value.
|
| 2421 |
|
| 2422 |
``` cpp
|
| 2423 |
int do_frac_digits() const;
|
| 2424 |
```
|
| 2425 |
|
| 2426 |
*Returns:* The number of digits after the decimal radix separator, if
|
| 2427 |
+
any.[^23]
|
| 2428 |
|
| 2429 |
``` cpp
|
| 2430 |
pattern do_pos_format() const;
|
| 2431 |
pattern do_neg_format() const;
|
| 2432 |
```
|
|
|
|
| 2438 |
- `moneypunct<wchar_t>`,
|
| 2439 |
- `moneypunct<char, true>`, and
|
| 2440 |
- `moneypunct<wchar_t, true>`,
|
| 2441 |
|
| 2442 |
return an object of type `pattern` initialized to
|
| 2443 |
+
`{ symbol, sign, none, value }`.[^24]
|
| 2444 |
|
| 2445 |
+
##### Class template `moneypunct_byname` <a id="locale.moneypunct.byname">[[locale.moneypunct.byname]]</a>
|
| 2446 |
|
| 2447 |
``` cpp
|
| 2448 |
namespace std {
|
| 2449 |
template<class charT, bool Intl = false>
|
| 2450 |
class moneypunct_byname : public moneypunct<charT, Intl> {
|
|
|
|
| 2459 |
~moneypunct_byname();
|
| 2460 |
};
|
| 2461 |
}
|
| 2462 |
```
|
| 2463 |
|
| 2464 |
+
#### The message retrieval category <a id="category.messages">[[category.messages]]</a>
|
| 2465 |
|
| 2466 |
+
##### General <a id="category.messages.general">[[category.messages.general]]</a>
|
| 2467 |
|
| 2468 |
Class `messages<charT>` implements retrieval of strings from message
|
| 2469 |
catalogs.
|
| 2470 |
|
| 2471 |
+
##### Class template `messages` <a id="locale.messages">[[locale.messages]]</a>
|
| 2472 |
|
| 2473 |
+
###### General <a id="locale.messages.general">[[locale.messages.general]]</a>
|
| 2474 |
|
| 2475 |
``` cpp
|
| 2476 |
namespace std {
|
| 2477 |
class messages_base {
|
| 2478 |
public:
|
|
|
|
| 2505 |
```
|
| 2506 |
|
| 2507 |
Values of type `messages_base::catalog` usable as arguments to members
|
| 2508 |
`get` and `close` can be obtained only by calling member `open`.
|
| 2509 |
|
| 2510 |
+
###### Members <a id="locale.messages.members">[[locale.messages.members]]</a>
|
| 2511 |
|
| 2512 |
``` cpp
|
| 2513 |
catalog open(const string& name, const locale& loc) const;
|
| 2514 |
```
|
| 2515 |
|
|
|
|
| 2525 |
void close(catalog cat) const;
|
| 2526 |
```
|
| 2527 |
|
| 2528 |
*Effects:* Calls `do_close(cat)`.
|
| 2529 |
|
| 2530 |
+
###### Virtual functions <a id="locale.messages.virtuals">[[locale.messages.virtuals]]</a>
|
| 2531 |
|
| 2532 |
``` cpp
|
| 2533 |
catalog do_open(const string& name, const locale& loc) const;
|
| 2534 |
```
|
| 2535 |
|
|
|
|
| 2564 |
*Effects:* Releases unspecified resources associated with `cat`.
|
| 2565 |
|
| 2566 |
*Remarks:* The limit on such resources, if any, is
|
| 2567 |
*implementation-defined*.
|
| 2568 |
|
| 2569 |
+
##### Class template `messages_byname` <a id="locale.messages.byname">[[locale.messages.byname]]</a>
|
| 2570 |
|
| 2571 |
``` cpp
|
| 2572 |
namespace std {
|
| 2573 |
template<class charT>
|
| 2574 |
class messages_byname : public messages<charT> {
|