xref: /dflybsd-src/contrib/gcc-8.0/libstdc++-v3/include/bits/regex_constants.h (revision 38fd149817dfbff97799f62fcb70be98c4e32523)
1*38fd1498Szrj // class template regex -*- C++ -*-
2*38fd1498Szrj 
3*38fd1498Szrj // Copyright (C) 2010-2018 Free Software Foundation, Inc.
4*38fd1498Szrj //
5*38fd1498Szrj // This file is part of the GNU ISO C++ Library.  This library is free
6*38fd1498Szrj // software; you can redistribute it and/or modify it under the
7*38fd1498Szrj // terms of the GNU General Public License as published by the
8*38fd1498Szrj // Free Software Foundation; either version 3, or (at your option)
9*38fd1498Szrj // any later version.
10*38fd1498Szrj 
11*38fd1498Szrj // This library is distributed in the hope that it will be useful,
12*38fd1498Szrj // but WITHOUT ANY WARRANTY; without even the implied warranty of
13*38fd1498Szrj // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*38fd1498Szrj // GNU General Public License for more details.
15*38fd1498Szrj 
16*38fd1498Szrj // Under Section 7 of GPL version 3, you are granted additional
17*38fd1498Szrj // permissions described in the GCC Runtime Library Exception, version
18*38fd1498Szrj // 3.1, as published by the Free Software Foundation.
19*38fd1498Szrj 
20*38fd1498Szrj // You should have received a copy of the GNU General Public License and
21*38fd1498Szrj // a copy of the GCC Runtime Library Exception along with this program;
22*38fd1498Szrj // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
23*38fd1498Szrj // <http://www.gnu.org/licenses/>.
24*38fd1498Szrj 
25*38fd1498Szrj /**
26*38fd1498Szrj  *  @file bits/regex_constants.h
27*38fd1498Szrj  *  @brief Constant definitions for the std regex library.
28*38fd1498Szrj  *
29*38fd1498Szrj  *  This is an internal header file, included by other library headers.
30*38fd1498Szrj  *  Do not attempt to use it directly. @headername{regex}
31*38fd1498Szrj  */
32*38fd1498Szrj 
_GLIBCXX_VISIBILITY(default)33*38fd1498Szrj namespace std _GLIBCXX_VISIBILITY(default)
34*38fd1498Szrj {
35*38fd1498Szrj _GLIBCXX_BEGIN_NAMESPACE_VERSION
36*38fd1498Szrj 
37*38fd1498Szrj /**
38*38fd1498Szrj  * @defgroup regex Regular Expressions
39*38fd1498Szrj  *
40*38fd1498Szrj  * A facility for performing regular expression pattern matching.
41*38fd1498Szrj  * @{
42*38fd1498Szrj  */
43*38fd1498Szrj 
44*38fd1498Szrj /**
45*38fd1498Szrj  * @namespace std::regex_constants
46*38fd1498Szrj  * @brief ISO C++-0x entities sub namespace for regex.
47*38fd1498Szrj  */
48*38fd1498Szrj namespace regex_constants
49*38fd1498Szrj {
50*38fd1498Szrj   /**
51*38fd1498Szrj    * @name 5.1 Regular Expression Syntax Options
52*38fd1498Szrj    */
53*38fd1498Szrj   //@{
54*38fd1498Szrj   enum __syntax_option
55*38fd1498Szrj   {
56*38fd1498Szrj     _S_icase,
57*38fd1498Szrj     _S_nosubs,
58*38fd1498Szrj     _S_optimize,
59*38fd1498Szrj     _S_collate,
60*38fd1498Szrj     _S_ECMAScript,
61*38fd1498Szrj     _S_basic,
62*38fd1498Szrj     _S_extended,
63*38fd1498Szrj     _S_awk,
64*38fd1498Szrj     _S_grep,
65*38fd1498Szrj     _S_egrep,
66*38fd1498Szrj     _S_polynomial,
67*38fd1498Szrj     _S_syntax_last
68*38fd1498Szrj   };
69*38fd1498Szrj 
70*38fd1498Szrj   /**
71*38fd1498Szrj    * @brief This is a bitmask type indicating how to interpret the regex.
72*38fd1498Szrj    *
73*38fd1498Szrj    * The @c syntax_option_type is implementation defined but it is valid to
74*38fd1498Szrj    * perform bitwise operations on these values and expect the right thing to
75*38fd1498Szrj    * happen.
76*38fd1498Szrj    *
77*38fd1498Szrj    * A valid value of type syntax_option_type shall have exactly one of the
78*38fd1498Szrj    * elements @c ECMAScript, @c basic, @c extended, @c awk, @c grep, @c egrep
79*38fd1498Szrj    * %set.
80*38fd1498Szrj    */
81*38fd1498Szrj   enum syntax_option_type : unsigned int { };
82*38fd1498Szrj 
83*38fd1498Szrj   /**
84*38fd1498Szrj    * Specifies that the matching of regular expressions against a character
85*38fd1498Szrj    * sequence shall be performed without regard to case.
86*38fd1498Szrj    */
87*38fd1498Szrj   _GLIBCXX17_INLINE constexpr syntax_option_type icase =
88*38fd1498Szrj     static_cast<syntax_option_type>(1 << _S_icase);
89*38fd1498Szrj 
90*38fd1498Szrj   /**
91*38fd1498Szrj    * Specifies that when a regular expression is matched against a character
92*38fd1498Szrj    * container sequence, no sub-expression matches are to be stored in the
93*38fd1498Szrj    * supplied match_results structure.
94*38fd1498Szrj    */
95*38fd1498Szrj   _GLIBCXX17_INLINE constexpr syntax_option_type nosubs =
96*38fd1498Szrj     static_cast<syntax_option_type>(1 << _S_nosubs);
97*38fd1498Szrj 
98*38fd1498Szrj   /**
99*38fd1498Szrj    * Specifies that the regular expression engine should pay more attention to
100*38fd1498Szrj    * the speed with which regular expressions are matched, and less to the
101*38fd1498Szrj    * speed with which regular expression objects are constructed. Otherwise
102*38fd1498Szrj    * it has no detectable effect on the program output.
103*38fd1498Szrj    */
104*38fd1498Szrj   _GLIBCXX17_INLINE constexpr syntax_option_type optimize =
105*38fd1498Szrj     static_cast<syntax_option_type>(1 << _S_optimize);
106*38fd1498Szrj 
107*38fd1498Szrj   /**
108*38fd1498Szrj    * Specifies that character ranges of the form [a-b] should be locale
109*38fd1498Szrj    * sensitive.
110*38fd1498Szrj    */
111*38fd1498Szrj   _GLIBCXX17_INLINE constexpr syntax_option_type collate =
112*38fd1498Szrj     static_cast<syntax_option_type>(1 << _S_collate);
113*38fd1498Szrj 
114*38fd1498Szrj   /**
115*38fd1498Szrj    * Specifies that the grammar recognized by the regular expression engine is
116*38fd1498Szrj    * that used by ECMAScript in ECMA-262 [Ecma International, ECMAScript
117*38fd1498Szrj    * Language Specification, Standard Ecma-262, third edition, 1999], as
118*38fd1498Szrj    * modified in section [28.13].  This grammar is similar to that defined
119*38fd1498Szrj    * in the PERL scripting language but extended with elements found in the
120*38fd1498Szrj    * POSIX regular expression grammar.
121*38fd1498Szrj    */
122*38fd1498Szrj   _GLIBCXX17_INLINE constexpr syntax_option_type ECMAScript =
123*38fd1498Szrj     static_cast<syntax_option_type>(1 << _S_ECMAScript);
124*38fd1498Szrj 
125*38fd1498Szrj   /**
126*38fd1498Szrj    * Specifies that the grammar recognized by the regular expression engine is
127*38fd1498Szrj    * that used by POSIX basic regular expressions in IEEE Std 1003.1-2001,
128*38fd1498Szrj    * Portable Operating System Interface (POSIX), Base Definitions and
129*38fd1498Szrj    * Headers, Section 9, Regular Expressions [IEEE, Information Technology --
130*38fd1498Szrj    * Portable Operating System Interface (POSIX), IEEE Standard 1003.1-2001].
131*38fd1498Szrj    */
132*38fd1498Szrj   _GLIBCXX17_INLINE constexpr syntax_option_type basic =
133*38fd1498Szrj     static_cast<syntax_option_type>(1 << _S_basic);
134*38fd1498Szrj 
135*38fd1498Szrj   /**
136*38fd1498Szrj    * Specifies that the grammar recognized by the regular expression engine is
137*38fd1498Szrj    * that used by POSIX extended regular expressions in IEEE Std 1003.1-2001,
138*38fd1498Szrj    * Portable Operating System Interface (POSIX), Base Definitions and
139*38fd1498Szrj    * Headers, Section 9, Regular Expressions.
140*38fd1498Szrj    */
141*38fd1498Szrj   _GLIBCXX17_INLINE constexpr syntax_option_type extended =
142*38fd1498Szrj     static_cast<syntax_option_type>(1 << _S_extended);
143*38fd1498Szrj 
144*38fd1498Szrj   /**
145*38fd1498Szrj    * Specifies that the grammar recognized by the regular expression engine is
146*38fd1498Szrj    * that used by POSIX utility awk in IEEE Std 1003.1-2001.  This option is
147*38fd1498Szrj    * identical to syntax_option_type extended, except that C-style escape
148*38fd1498Szrj    * sequences are supported.  These sequences are:
149*38fd1498Szrj    * \\\\, \\a, \\b, \\f, \\n, \\r, \\t , \\v, \\&apos,, &apos,,
150*38fd1498Szrj    * and \\ddd (where ddd is one, two, or three octal digits).
151*38fd1498Szrj    */
152*38fd1498Szrj   _GLIBCXX17_INLINE constexpr syntax_option_type awk =
153*38fd1498Szrj     static_cast<syntax_option_type>(1 << _S_awk);
154*38fd1498Szrj 
155*38fd1498Szrj   /**
156*38fd1498Szrj    * Specifies that the grammar recognized by the regular expression engine is
157*38fd1498Szrj    * that used by POSIX utility grep in IEEE Std 1003.1-2001.  This option is
158*38fd1498Szrj    * identical to syntax_option_type basic, except that newlines are treated
159*38fd1498Szrj    * as whitespace.
160*38fd1498Szrj    */
161*38fd1498Szrj   _GLIBCXX17_INLINE constexpr syntax_option_type grep =
162*38fd1498Szrj     static_cast<syntax_option_type>(1 << _S_grep);
163*38fd1498Szrj 
164*38fd1498Szrj   /**
165*38fd1498Szrj    * Specifies that the grammar recognized by the regular expression engine is
166*38fd1498Szrj    * that used by POSIX utility grep when given the -E option in
167*38fd1498Szrj    * IEEE Std 1003.1-2001.  This option is identical to syntax_option_type
168*38fd1498Szrj    * extended, except that newlines are treated as whitespace.
169*38fd1498Szrj    */
170*38fd1498Szrj   _GLIBCXX17_INLINE constexpr syntax_option_type egrep =
171*38fd1498Szrj     static_cast<syntax_option_type>(1 << _S_egrep);
172*38fd1498Szrj 
173*38fd1498Szrj   /**
174*38fd1498Szrj    * Extension: Ensure both space complexity of compiled regex and
175*38fd1498Szrj    * time complexity execution are not exponential.
176*38fd1498Szrj    * If specified in a regex with back-references, the exception
177*38fd1498Szrj    * regex_constants::error_complexity will be thrown.
178*38fd1498Szrj    */
179*38fd1498Szrj   _GLIBCXX17_INLINE constexpr syntax_option_type __polynomial =
180*38fd1498Szrj     static_cast<syntax_option_type>(1 << _S_polynomial);
181*38fd1498Szrj 
182*38fd1498Szrj   constexpr inline syntax_option_type
183*38fd1498Szrj   operator&(syntax_option_type __a, syntax_option_type __b)
184*38fd1498Szrj   {
185*38fd1498Szrj     return (syntax_option_type)(static_cast<unsigned int>(__a)
186*38fd1498Szrj 				& static_cast<unsigned int>(__b));
187*38fd1498Szrj   }
188*38fd1498Szrj 
189*38fd1498Szrj   constexpr inline syntax_option_type
190*38fd1498Szrj   operator|(syntax_option_type __a, syntax_option_type __b)
191*38fd1498Szrj   {
192*38fd1498Szrj     return (syntax_option_type)(static_cast<unsigned int>(__a)
193*38fd1498Szrj 				| static_cast<unsigned int>(__b));
194*38fd1498Szrj   }
195*38fd1498Szrj 
196*38fd1498Szrj   constexpr inline syntax_option_type
197*38fd1498Szrj   operator^(syntax_option_type __a, syntax_option_type __b)
198*38fd1498Szrj   {
199*38fd1498Szrj     return (syntax_option_type)(static_cast<unsigned int>(__a)
200*38fd1498Szrj 				^ static_cast<unsigned int>(__b));
201*38fd1498Szrj   }
202*38fd1498Szrj 
203*38fd1498Szrj   constexpr inline syntax_option_type
204*38fd1498Szrj   operator~(syntax_option_type __a)
205*38fd1498Szrj   { return (syntax_option_type)(~static_cast<unsigned int>(__a)); }
206*38fd1498Szrj 
207*38fd1498Szrj   inline syntax_option_type&
208*38fd1498Szrj   operator&=(syntax_option_type& __a, syntax_option_type __b)
209*38fd1498Szrj   { return __a = __a & __b; }
210*38fd1498Szrj 
211*38fd1498Szrj   inline syntax_option_type&
212*38fd1498Szrj   operator|=(syntax_option_type& __a, syntax_option_type __b)
213*38fd1498Szrj   { return __a = __a | __b; }
214*38fd1498Szrj 
215*38fd1498Szrj   inline syntax_option_type&
216*38fd1498Szrj   operator^=(syntax_option_type& __a, syntax_option_type __b)
217*38fd1498Szrj   { return __a = __a ^ __b; }
218*38fd1498Szrj 
219*38fd1498Szrj   //@}
220*38fd1498Szrj 
221*38fd1498Szrj   /**
222*38fd1498Szrj    * @name 5.2 Matching Rules
223*38fd1498Szrj    *
224*38fd1498Szrj    * Matching a regular expression against a sequence of characters [first,
225*38fd1498Szrj    * last) proceeds according to the rules of the grammar specified for the
226*38fd1498Szrj    * regular expression object, modified according to the effects listed
227*38fd1498Szrj    * below for any bitmask elements set.
228*38fd1498Szrj    *
229*38fd1498Szrj    */
230*38fd1498Szrj   //@{
231*38fd1498Szrj 
232*38fd1498Szrj   enum __match_flag
233*38fd1498Szrj   {
234*38fd1498Szrj     _S_not_bol,
235*38fd1498Szrj     _S_not_eol,
236*38fd1498Szrj     _S_not_bow,
237*38fd1498Szrj     _S_not_eow,
238*38fd1498Szrj     _S_any,
239*38fd1498Szrj     _S_not_null,
240*38fd1498Szrj     _S_continuous,
241*38fd1498Szrj     _S_prev_avail,
242*38fd1498Szrj     _S_sed,
243*38fd1498Szrj     _S_no_copy,
244*38fd1498Szrj     _S_first_only,
245*38fd1498Szrj     _S_match_flag_last
246*38fd1498Szrj   };
247*38fd1498Szrj 
248*38fd1498Szrj   /**
249*38fd1498Szrj    * @brief This is a bitmask type indicating regex matching rules.
250*38fd1498Szrj    *
251*38fd1498Szrj    * The @c match_flag_type is implementation defined but it is valid to
252*38fd1498Szrj    * perform bitwise operations on these values and expect the right thing to
253*38fd1498Szrj    * happen.
254*38fd1498Szrj    */
255*38fd1498Szrj   enum match_flag_type : unsigned int { };
256*38fd1498Szrj 
257*38fd1498Szrj   /**
258*38fd1498Szrj    * The default matching rules.
259*38fd1498Szrj    */
260*38fd1498Szrj   _GLIBCXX17_INLINE constexpr match_flag_type match_default =
261*38fd1498Szrj     static_cast<match_flag_type>(0);
262*38fd1498Szrj 
263*38fd1498Szrj   /**
264*38fd1498Szrj    * The first character in the sequence [first, last) is treated as though it
265*38fd1498Szrj    * is not at the beginning of a line, so the character (^) in the regular
266*38fd1498Szrj    * expression shall not match [first, first).
267*38fd1498Szrj    */
268*38fd1498Szrj   _GLIBCXX17_INLINE constexpr match_flag_type match_not_bol =
269*38fd1498Szrj     static_cast<match_flag_type>(1 << _S_not_bol);
270*38fd1498Szrj 
271*38fd1498Szrj   /**
272*38fd1498Szrj    * The last character in the sequence [first, last) is treated as though it
273*38fd1498Szrj    * is not at the end of a line, so the character ($) in the regular
274*38fd1498Szrj    * expression shall not match [last, last).
275*38fd1498Szrj    */
276*38fd1498Szrj   _GLIBCXX17_INLINE constexpr match_flag_type match_not_eol =
277*38fd1498Szrj     static_cast<match_flag_type>(1 << _S_not_eol);
278*38fd1498Szrj 
279*38fd1498Szrj   /**
280*38fd1498Szrj    * The expression \\b is not matched against the sub-sequence
281*38fd1498Szrj    * [first,first).
282*38fd1498Szrj    */
283*38fd1498Szrj   _GLIBCXX17_INLINE constexpr match_flag_type match_not_bow =
284*38fd1498Szrj     static_cast<match_flag_type>(1 << _S_not_bow);
285*38fd1498Szrj 
286*38fd1498Szrj   /**
287*38fd1498Szrj    * The expression \\b should not be matched against the sub-sequence
288*38fd1498Szrj    * [last,last).
289*38fd1498Szrj    */
290*38fd1498Szrj   _GLIBCXX17_INLINE constexpr match_flag_type match_not_eow =
291*38fd1498Szrj     static_cast<match_flag_type>(1 << _S_not_eow);
292*38fd1498Szrj 
293*38fd1498Szrj   /**
294*38fd1498Szrj    * If more than one match is possible then any match is an acceptable
295*38fd1498Szrj    * result.
296*38fd1498Szrj    */
297*38fd1498Szrj   _GLIBCXX17_INLINE constexpr match_flag_type match_any =
298*38fd1498Szrj     static_cast<match_flag_type>(1 << _S_any);
299*38fd1498Szrj 
300*38fd1498Szrj   /**
301*38fd1498Szrj    * The expression does not match an empty sequence.
302*38fd1498Szrj    */
303*38fd1498Szrj   _GLIBCXX17_INLINE constexpr match_flag_type match_not_null =
304*38fd1498Szrj     static_cast<match_flag_type>(1 << _S_not_null);
305*38fd1498Szrj 
306*38fd1498Szrj   /**
307*38fd1498Szrj    * The expression only matches a sub-sequence that begins at first .
308*38fd1498Szrj    */
309*38fd1498Szrj   _GLIBCXX17_INLINE constexpr match_flag_type match_continuous =
310*38fd1498Szrj     static_cast<match_flag_type>(1 << _S_continuous);
311*38fd1498Szrj 
312*38fd1498Szrj   /**
313*38fd1498Szrj    * --first is a valid iterator position.  When this flag is set then the
314*38fd1498Szrj    * flags match_not_bol and match_not_bow are ignored by the regular
315*38fd1498Szrj    * expression algorithms 28.11 and iterators 28.12.
316*38fd1498Szrj    */
317*38fd1498Szrj   _GLIBCXX17_INLINE constexpr match_flag_type match_prev_avail =
318*38fd1498Szrj     static_cast<match_flag_type>(1 << _S_prev_avail);
319*38fd1498Szrj 
320*38fd1498Szrj   /**
321*38fd1498Szrj    * When a regular expression match is to be replaced by a new string, the
322*38fd1498Szrj    * new string is constructed using the rules used by the ECMAScript replace
323*38fd1498Szrj    * function in ECMA- 262 [Ecma International, ECMAScript Language
324*38fd1498Szrj    * Specification, Standard Ecma-262, third edition, 1999], part 15.5.4.11
325*38fd1498Szrj    * String.prototype.replace. In addition, during search and replace
326*38fd1498Szrj    * operations all non-overlapping occurrences of the regular expression
327*38fd1498Szrj    * are located and replaced, and sections of the input that did not match
328*38fd1498Szrj    * the expression are copied unchanged to the output string.
329*38fd1498Szrj    *
330*38fd1498Szrj    * Format strings (from ECMA-262 [15.5.4.11]):
331*38fd1498Szrj    * @li $$  The dollar-sign itself ($)
332*38fd1498Szrj    * @li $&  The matched substring.
333*38fd1498Szrj    * @li $`  The portion of @a string that precedes the matched substring.
334*38fd1498Szrj    *         This would be match_results::prefix().
335*38fd1498Szrj    * @li $'  The portion of @a string that follows the matched substring.
336*38fd1498Szrj    *         This would be match_results::suffix().
337*38fd1498Szrj    * @li $n  The nth capture, where n is in [1,9] and $n is not followed by a
338*38fd1498Szrj    *         decimal digit.  If n <= match_results::size() and the nth capture
339*38fd1498Szrj    *         is undefined, use the empty string instead.  If n >
340*38fd1498Szrj    *         match_results::size(), the result is implementation-defined.
341*38fd1498Szrj    * @li $nn The nnth capture, where nn is a two-digit decimal number on
342*38fd1498Szrj    *         [01, 99].  If nn <= match_results::size() and the nth capture is
343*38fd1498Szrj    *         undefined, use the empty string instead. If
344*38fd1498Szrj    *         nn > match_results::size(), the result is implementation-defined.
345*38fd1498Szrj    */
346*38fd1498Szrj   _GLIBCXX17_INLINE constexpr match_flag_type format_default =
347*38fd1498Szrj     static_cast<match_flag_type>(0);
348*38fd1498Szrj 
349*38fd1498Szrj   /**
350*38fd1498Szrj    * When a regular expression match is to be replaced by a new string, the
351*38fd1498Szrj    * new string is constructed using the rules used by the POSIX sed utility
352*38fd1498Szrj    * in IEEE Std 1003.1- 2001 [IEEE, Information Technology -- Portable
353*38fd1498Szrj    * Operating System Interface (POSIX), IEEE Standard 1003.1-2001].
354*38fd1498Szrj    */
355*38fd1498Szrj   _GLIBCXX17_INLINE constexpr match_flag_type format_sed =
356*38fd1498Szrj     static_cast<match_flag_type>(1 << _S_sed);
357*38fd1498Szrj 
358*38fd1498Szrj   /**
359*38fd1498Szrj    * During a search and replace operation, sections of the character
360*38fd1498Szrj    * container sequence being searched that do not match the regular
361*38fd1498Szrj    * expression shall not be copied to the output string.
362*38fd1498Szrj    */
363*38fd1498Szrj   _GLIBCXX17_INLINE constexpr match_flag_type format_no_copy =
364*38fd1498Szrj     static_cast<match_flag_type>(1 << _S_no_copy);
365*38fd1498Szrj 
366*38fd1498Szrj   /**
367*38fd1498Szrj    * When specified during a search and replace operation, only the first
368*38fd1498Szrj    * occurrence of the regular expression shall be replaced.
369*38fd1498Szrj    */
370*38fd1498Szrj   _GLIBCXX17_INLINE constexpr match_flag_type format_first_only =
371*38fd1498Szrj     static_cast<match_flag_type>(1 << _S_first_only);
372*38fd1498Szrj 
373*38fd1498Szrj   constexpr inline match_flag_type
374*38fd1498Szrj   operator&(match_flag_type __a, match_flag_type __b)
375*38fd1498Szrj   {
376*38fd1498Szrj     return (match_flag_type)(static_cast<unsigned int>(__a)
377*38fd1498Szrj 				& static_cast<unsigned int>(__b));
378*38fd1498Szrj   }
379*38fd1498Szrj 
380*38fd1498Szrj   constexpr inline match_flag_type
381*38fd1498Szrj   operator|(match_flag_type __a, match_flag_type __b)
382*38fd1498Szrj   {
383*38fd1498Szrj     return (match_flag_type)(static_cast<unsigned int>(__a)
384*38fd1498Szrj 				| static_cast<unsigned int>(__b));
385*38fd1498Szrj   }
386*38fd1498Szrj 
387*38fd1498Szrj   constexpr inline match_flag_type
388*38fd1498Szrj   operator^(match_flag_type __a, match_flag_type __b)
389*38fd1498Szrj   {
390*38fd1498Szrj     return (match_flag_type)(static_cast<unsigned int>(__a)
391*38fd1498Szrj 				^ static_cast<unsigned int>(__b));
392*38fd1498Szrj   }
393*38fd1498Szrj 
394*38fd1498Szrj   constexpr inline match_flag_type
395*38fd1498Szrj   operator~(match_flag_type __a)
396*38fd1498Szrj   { return (match_flag_type)(~static_cast<unsigned int>(__a)); }
397*38fd1498Szrj 
398*38fd1498Szrj   inline match_flag_type&
399*38fd1498Szrj   operator&=(match_flag_type& __a, match_flag_type __b)
400*38fd1498Szrj   { return __a = __a & __b; }
401*38fd1498Szrj 
402*38fd1498Szrj   inline match_flag_type&
403*38fd1498Szrj   operator|=(match_flag_type& __a, match_flag_type __b)
404*38fd1498Szrj   { return __a = __a | __b; }
405*38fd1498Szrj 
406*38fd1498Szrj   inline match_flag_type&
407*38fd1498Szrj   operator^=(match_flag_type& __a, match_flag_type __b)
408*38fd1498Szrj   { return __a = __a ^ __b; }
409*38fd1498Szrj 
410*38fd1498Szrj   //@}
411*38fd1498Szrj } // namespace regex_constants
412*38fd1498Szrj /* @} */ // group regex
413*38fd1498Szrj 
414*38fd1498Szrj _GLIBCXX_END_NAMESPACE_VERSION
415*38fd1498Szrj } // namespace std
416*38fd1498Szrj 
417