tmp/tmplfcek913/{from.md → to.md}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
| 1 |
#### `ctype` specializations <a id="facet.ctype.special">[[facet.ctype.special]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
-
template <>
|
| 6 |
-
: public locale::facet, public ctype_base {
|
| 7 |
public:
|
| 8 |
-
|
| 9 |
|
| 10 |
explicit ctype(const mask* tab = 0, bool del = false,
|
| 11 |
size_t refs = 0);
|
| 12 |
|
| 13 |
bool is(mask m, char c) const;
|
|
@@ -52,21 +52,21 @@ namespace std {
|
|
| 52 |
};
|
| 53 |
}
|
| 54 |
```
|
| 55 |
|
| 56 |
A specialization `ctype<char>` is provided so that the member functions
|
| 57 |
-
on type `char` can be implemented `inline`.[^
|
| 58 |
*implementation-defined* value of member `table_size` is at least 256.
|
| 59 |
|
| 60 |
##### `ctype<char>` destructor <a id="facet.ctype.char.dtor">[[facet.ctype.char.dtor]]</a>
|
| 61 |
|
| 62 |
``` cpp
|
| 63 |
~ctype();
|
| 64 |
```
|
| 65 |
|
| 66 |
*Effects:* If the constructor’s first argument was nonzero, and its
|
| 67 |
-
second argument was true, does `delete [] table()`.
|
| 68 |
|
| 69 |
##### `ctype<char>` members <a id="facet.ctype.char.members">[[facet.ctype.char.members]]</a>
|
| 70 |
|
| 71 |
In the following member descriptions, for `unsigned char` values `v`
|
| 72 |
where `v >= table_size`, `table()[v]` is assumed to have an
|
|
@@ -76,22 +76,23 @@ implementation-specific value (possibly different for each such value
|
|
| 76 |
``` cpp
|
| 77 |
explicit ctype(const mask* tbl = 0, bool del = false,
|
| 78 |
size_t refs = 0);
|
| 79 |
```
|
| 80 |
|
| 81 |
-
`tbl` either 0 or an array of at least `table_size`
|
|
|
|
| 82 |
|
| 83 |
*Effects:* Passes its `refs` argument to its base class constructor.
|
| 84 |
|
| 85 |
``` cpp
|
| 86 |
bool is(mask m, char c) const;
|
| 87 |
const char* is(const char* low, const char* high,
|
| 88 |
mask* vec) const;
|
| 89 |
```
|
| 90 |
|
| 91 |
*Effects:* The second form, for all `*p` in the range \[`low`, `high`),
|
| 92 |
-
assigns into `vec[p-low]` the value `table()[
|
| 93 |
|
| 94 |
*Returns:* The first form returns `table()[(unsigned char)c] & m`; the
|
| 95 |
second form returns `high`.
|
| 96 |
|
| 97 |
``` cpp
|
|
@@ -153,22 +154,22 @@ respectively.
|
|
| 153 |
|
| 154 |
``` cpp
|
| 155 |
const mask* table() const noexcept;
|
| 156 |
```
|
| 157 |
|
| 158 |
-
*Returns:* The first constructor argument, if it was
|
| 159 |
`classic_table()`.
|
| 160 |
|
| 161 |
##### `ctype<char>` static members <a id="facet.ctype.char.statics">[[facet.ctype.char.statics]]</a>
|
| 162 |
|
| 163 |
``` cpp
|
| 164 |
static const mask* classic_table() noexcept;
|
| 165 |
```
|
| 166 |
|
| 167 |
*Returns:* A pointer to the initial element of an array of size
|
| 168 |
`table_size` which represents the classifications of characters in the
|
| 169 |
-
"C" locale.
|
| 170 |
|
| 171 |
##### `ctype<char>` virtual functions <a id="facet.ctype.char.virtuals">[[facet.ctype.char.virtuals]]</a>
|
| 172 |
|
| 173 |
``` cpp
|
| 174 |
char do_toupper(char) const;
|
|
|
|
| 1 |
#### `ctype` specializations <a id="facet.ctype.special">[[facet.ctype.special]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
+
template <>
|
| 6 |
+
class ctype<char> : public locale::facet, public ctype_base {
|
| 7 |
public:
|
| 8 |
+
using char_type = char;
|
| 9 |
|
| 10 |
explicit ctype(const mask* tab = 0, bool del = false,
|
| 11 |
size_t refs = 0);
|
| 12 |
|
| 13 |
bool is(mask m, char c) const;
|
|
|
|
| 52 |
};
|
| 53 |
}
|
| 54 |
```
|
| 55 |
|
| 56 |
A specialization `ctype<char>` is provided so that the member functions
|
| 57 |
+
on type `char` can be implemented `inline`.[^7] The
|
| 58 |
*implementation-defined* value of member `table_size` is at least 256.
|
| 59 |
|
| 60 |
##### `ctype<char>` destructor <a id="facet.ctype.char.dtor">[[facet.ctype.char.dtor]]</a>
|
| 61 |
|
| 62 |
``` cpp
|
| 63 |
~ctype();
|
| 64 |
```
|
| 65 |
|
| 66 |
*Effects:* If the constructor’s first argument was nonzero, and its
|
| 67 |
+
second argument was `true`, does `delete [] table()`.
|
| 68 |
|
| 69 |
##### `ctype<char>` members <a id="facet.ctype.char.members">[[facet.ctype.char.members]]</a>
|
| 70 |
|
| 71 |
In the following member descriptions, for `unsigned char` values `v`
|
| 72 |
where `v >= table_size`, `table()[v]` is assumed to have an
|
|
|
|
| 76 |
``` cpp
|
| 77 |
explicit ctype(const mask* tbl = 0, bool del = false,
|
| 78 |
size_t refs = 0);
|
| 79 |
```
|
| 80 |
|
| 81 |
+
*Requires:* `tbl` either 0 or an array of at least `table_size`
|
| 82 |
+
elements.
|
| 83 |
|
| 84 |
*Effects:* Passes its `refs` argument to its base class constructor.
|
| 85 |
|
| 86 |
``` cpp
|
| 87 |
bool is(mask m, char c) const;
|
| 88 |
const char* is(const char* low, const char* high,
|
| 89 |
mask* vec) const;
|
| 90 |
```
|
| 91 |
|
| 92 |
*Effects:* The second form, for all `*p` in the range \[`low`, `high`),
|
| 93 |
+
assigns into `vec[p - low]` the value `table()[(unsigned char)*p]`.
|
| 94 |
|
| 95 |
*Returns:* The first form returns `table()[(unsigned char)c] & m`; the
|
| 96 |
second form returns `high`.
|
| 97 |
|
| 98 |
``` cpp
|
|
|
|
| 154 |
|
| 155 |
``` cpp
|
| 156 |
const mask* table() const noexcept;
|
| 157 |
```
|
| 158 |
|
| 159 |
+
*Returns:* The first constructor argument, if it was nonzero, otherwise
|
| 160 |
`classic_table()`.
|
| 161 |
|
| 162 |
##### `ctype<char>` static members <a id="facet.ctype.char.statics">[[facet.ctype.char.statics]]</a>
|
| 163 |
|
| 164 |
``` cpp
|
| 165 |
static const mask* classic_table() noexcept;
|
| 166 |
```
|
| 167 |
|
| 168 |
*Returns:* A pointer to the initial element of an array of size
|
| 169 |
`table_size` which represents the classifications of characters in the
|
| 170 |
+
`"C"` locale.
|
| 171 |
|
| 172 |
##### `ctype<char>` virtual functions <a id="facet.ctype.char.virtuals">[[facet.ctype.char.virtuals]]</a>
|
| 173 |
|
| 174 |
``` cpp
|
| 175 |
char do_toupper(char) const;
|