2 / Copyright (c) 2008 Eric Niebler
4 / Distributed under the Boost Software License, Version 1.0. (See accompanying
5 / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
10 [h2 CharT requirements]
11 If type `BidiIterT` is used as a template argument to _basic_regex_, then `CharT` is
12 `iterator_traits<BidiIterT>::value_type`. Type `CharT` must have a trivial default
13 constructor, copy constructor, assignment operator, and destructor. In addition
14 the following requirements must be met for objects; `c` of type `CharT`, `c1` and `c2` of
15 type `CharT const`, and `i` of type `int`:
17 [table CharT Requirements
21 [[*Assertion / Note / Pre- / Post-condition]]
26 [Default constructor (must be trivial).]
31 [Copy constructor (must be trivial).]
36 [Assignment operator (must be trivial).]
41 [`true` if `c1` has the same value as `c2`.]
46 [`true` if `c1` and `c2` are not equal.]
51 [`true` if the value of `c1` is less than `c2`.]
56 [`true` if the value of `c1` is greater than `c2`.]
61 [`true` if `c1` is less than or equal to `c2`.]
66 [`true` if `c1` is greater than or equal to `c2`.]
72 `CharT` must be convertible to an integral type.
78 [`CharT` must be constructable from an integral type.]
82 [h2 Traits Requirements]
83 In the following table `X` denotes a traits class defining types and functions
84 for the character container type `CharT`; `u` is an object of type `X`; `v` is an
85 object of type `const X`; `p` is a value of type `const CharT*`; `I1` and `I2` are
86 `Input Iterators`; `c` is a value of type `const CharT`; `s` is an object of type
87 `X::string_type`; `cs` is an object of type `const X::string_type`; `b` is a value of
88 type `bool`; `i` is a value of type `int`; `F1` and `F2` are values of type `const CharT*`;
89 `loc` is an object of type `X::locale_type`; and `ch` is an object of `const char`.
91 [table Traits Requirements
101 Pre / Post condition]
112 The character container type used in the implementation of class template _basic_regex_.
120 `std::basic_string<CharT>` or `std::vector<CharT>`
131 ['Implementation defined]
134 A copy constructible type that represents the locale used by the traits class.
142 ['Implementation defined]
145 A bitmask type representing a particular character classification. Multiple
146 values of this type can be bitwise-or'ed together to obtain a new valid value.
157 Yields a value between `0` and `UCHAR_MAX` inclusive.
168 Widens the specified `char` and returns the resulting `CharT`.
173 `v.in_range(r1, r2, c)`
179 For any characters `r1` and `r2`, returns `true` if `r1 <= c && c <= r2`.
180 Requires that `r1 <= r2`.
185 `v.in_range_nocase(r1, r2, c)`
191 For characters `r1` and `r2`, returns `true` if there is some character
192 `d` for which `v.translate_nocase(d) == v.translate_nocase(c)` and
193 `r1 <= d && d <= r2`. Requires that `r1 <= r2`.
204 Returns a character such that for any character `d` that is to be considered
205 equivalent to `c` then `v.translate(c) == v.translate(d)`.
210 `v.translate_nocase(c)`
216 For all characters `C` that are to be considered
217 equivalent to `c` when comparisons are to be performed without regard to case,
218 then `v.translate_nocase(c) == v.translate_nocase(C)`.
223 `v.transform(F1, F2)`
229 Returns a sort key for the character sequence designated by the iterator range
230 `[F1, F2)` such that if the character sequence `[G1, G2)` sorts before the
231 character sequence `[H1, H2)` then `v.transform(G1, G2) < v.transform(H1, H2)`.
236 `v.transform_primary(F1, F2)`
242 Returns a sort key for the character sequence designated by the iterator range
243 `[F1, F2)` such that if the character sequence `[G1, G2)` sorts before the
244 character sequence `[H1, H2)` when character case is not considered then
245 `v.transform_primary(G1, G2) < v.transform_primary(H1, H2)`.
250 `v.lookup_classname(F1, F2)`
256 Converts the character sequence designated by the iterator range `[F1,F2)` into a
257 bitmask type that can subsequently be passed to `isctype`. Values returned from
258 `lookup_classname` can be safely bitwise or'ed together. Returns `0` if the
259 character sequence is not the name of a character class recognized by `X`. The
260 value returned shall be independent of the case of the characters in the
266 `v.lookup_collatename(F1, F2)`
272 Returns a sequence of characters that represents the collating element
273 consisting of the character sequence designated by the iterator range `[F1, F2)`.
274 Returns an empty string if the character sequence is not a valid collating
280 `v.isctype(c, v.lookup_classname(F1, F2))`
286 Returns `true` if character `c` is a member of the character class designated by
287 the iterator range `[F1, F2)`, `false` otherwise.
298 Returns the value represented by the digit `c` in base `i` if the character `c` is a
299 valid digit in base `i`; otherwise returns `-1`.\n
300 \[Note: the value of `i` will only be `8`, `10`, or `16`. -end note\]
311 Imbues `u` with the locale `loc`, returns the previous
323 Returns the current locale used by `v`.
328 [h2 Acknowledgements]
330 This section is adapted from the equivalent page in the _regexpp_ documentation and from the
331 _proposal_ to add regular expressions to the Standard Library.