wildcards.hpp
Go to the documentation of this file.
1 // THIS FILE HAS BEEN GENERATED AUTOMATICALLY. DO NOT EDIT DIRECTLY.
2 // Generated: 2019-03-08 09:59:35.958950200
3 // Copyright Tomas Zeman 2018.
4 // Distributed under the Boost Software License, Version 1.0.
5 // (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
7 #ifndef WILDCARDS_HPP
8 #define WILDCARDS_HPP
9 #define WILDCARDS_VERSION_MAJOR 1
10 #define WILDCARDS_VERSION_MINOR 5
11 #define WILDCARDS_VERSION_PATCH 0
12 #ifndef WILDCARDS_CARDS_HPP
13 #define WILDCARDS_CARDS_HPP
14 #include <utility>
15 namespace wildcards
16 {
17 template <typename T>
18 struct cards
19 {
20 constexpr cards(T a, T s, T e)
21 : anything{std::move(a)},
22 single{std::move(s)},
23 escape{std::move(e)},
24 set_enabled{false},
25 alt_enabled{false}
26 {
27 }
28 constexpr cards(T a, T s, T e, T so, T sc, T sn, T ao, T ac, T ar)
29 : anything{std::move(a)},
30 single{std::move(s)},
31 escape{std::move(e)},
32 set_enabled{true},
33 set_open{std::move(so)},
34 set_close{std::move(sc)},
35 set_not{std::move(sn)},
36 alt_enabled{true},
37 alt_open{std::move(ao)},
38 alt_close{std::move(ac)},
39 alt_or{std::move(ar)}
40 {
41 }
53 };
54 enum class cards_type
55 {
56 standard,
58 };
59 template <>
60 struct cards<char>
61 {
64 {
65 }
66 constexpr cards(char a, char s, char e)
67 : anything{std::move(a)},
68 single{std::move(s)},
69 escape{std::move(e)},
70 set_enabled{false},
71 alt_enabled{false}
72 {
73 }
74 constexpr cards(char a, char s, char e, char so, char sc, char sn, char ao, char ac, char ar)
75 : anything{std::move(a)},
76 single{std::move(s)},
77 escape{std::move(e)},
78 set_enabled{true},
79 set_open{std::move(so)},
80 set_close{std::move(sc)},
81 set_not{std::move(sn)},
82 alt_enabled{true},
83 alt_open{std::move(ao)},
84 alt_close{std::move(ac)},
85 alt_or{std::move(ar)}
86 {
87 }
88 char anything{'*'};
89 char single{'?'};
90 char escape{'\\'};
91 bool set_enabled{true};
92 char set_open{'['};
93 char set_close{']'};
94 char set_not{'!'};
95 bool alt_enabled{true};
96 char alt_open{'('};
97 char alt_close{')'};
98 char alt_or{'|'};
99 };
100 template <>
101 struct cards<char16_t>
102 {
105 {
106 }
107 constexpr cards(char16_t a, char16_t s, char16_t e)
108 : anything{std::move(a)},
109 single{std::move(s)},
110 escape{std::move(e)},
111 set_enabled{false},
112 alt_enabled{false}
113 {
114 }
115 constexpr cards(char16_t a, char16_t s, char16_t e, char16_t so, char16_t sc, char16_t sn,
116 char16_t ao, char16_t ac, char16_t ar)
117 : anything{std::move(a)},
118 single{std::move(s)},
119 escape{std::move(e)},
120 set_enabled{true},
121 set_open{std::move(so)},
122 set_close{std::move(sc)},
123 set_not{std::move(sn)},
124 alt_enabled{true},
125 alt_open{std::move(ao)},
126 alt_close{std::move(ac)},
127 alt_or{std::move(ar)}
128 {
129 }
130 char16_t anything{u'*'};
131 char16_t single{u'?'};
132 char16_t escape{u'\\'};
133 bool set_enabled{true};
134 char16_t set_open{u'['};
135 char16_t set_close{u']'};
136 char16_t set_not{u'!'};
137 bool alt_enabled{true};
138 char16_t alt_open{u'('};
139 char16_t alt_close{u')'};
140 char16_t alt_or{u'|'};
141 };
142 template <>
143 struct cards<char32_t>
144 {
147 {
148 }
149 constexpr cards(char32_t a, char32_t s, char32_t e)
150 : anything{std::move(a)},
151 single{std::move(s)},
152 escape{std::move(e)},
153 set_enabled{false},
154 alt_enabled{false}
155 {
156 }
157 constexpr cards(char32_t a, char32_t s, char32_t e, char32_t so, char32_t sc, char32_t sn,
158 char32_t ao, char32_t ac, char32_t ar)
159 : anything{std::move(a)},
160 single{std::move(s)},
161 escape{std::move(e)},
162 set_enabled{true},
163 set_open{std::move(so)},
164 set_close{std::move(sc)},
165 set_not{std::move(sn)},
166 alt_enabled{true},
167 alt_open{std::move(ao)},
168 alt_close{std::move(ac)},
169 alt_or{std::move(ar)}
170 {
171 }
172 char32_t anything{U'*'};
173 char32_t single{U'?'};
174 char32_t escape{U'\\'};
175 bool set_enabled{true};
176 char32_t set_open{U'['};
177 char32_t set_close{U']'};
178 char32_t set_not{U'!'};
179 bool alt_enabled{true};
180 char32_t alt_open{U'('};
181 char32_t alt_close{U')'};
182 char32_t alt_or{U'|'};
183 };
184 template <>
185 struct cards<wchar_t>
186 {
189 {
190 }
191 constexpr cards(wchar_t a, wchar_t s, wchar_t e)
192 : anything{std::move(a)},
193 single{std::move(s)},
194 escape{std::move(e)},
195 set_enabled{false},
196 alt_enabled{false}
197 {
198 }
199 constexpr cards(wchar_t a, wchar_t s, wchar_t e, wchar_t so, wchar_t sc, wchar_t sn, wchar_t ao,
200 wchar_t ac, wchar_t ar)
201 : anything{std::move(a)},
202 single{std::move(s)},
203 escape{std::move(e)},
204 set_enabled{true},
205 set_open{std::move(so)},
206 set_close{std::move(sc)},
207 set_not{std::move(sn)},
208 alt_enabled{true},
209 alt_open{std::move(ao)},
210 alt_close{std::move(ac)},
211 alt_or{std::move(ar)}
212 {
213 }
214 wchar_t anything{L'*'};
215 wchar_t single{L'?'};
216 wchar_t escape{L'\\'};
217 bool set_enabled{true};
218 wchar_t set_open{L'['};
219 wchar_t set_close{L']'};
220 wchar_t set_not{L'!'};
221 bool alt_enabled{true};
222 wchar_t alt_open{L'('};
223 wchar_t alt_close{L')'};
224 wchar_t alt_or{L'|'};
225 };
226 template <typename T>
227 constexpr cards<T> make_cards(T&& a, T&& s, T&& e)
228 {
229 return {std::forward<T>(a), std::forward<T>(s), std::forward<T>(e)};
230 }
231 template <typename T>
232 constexpr cards<T> make_cards(T&& a, T&& s, T&& e, T&& so, T&& sc, T&& sn, T&& ao, T&& ac, T&& ar)
233 {
234 return {std::forward<T>(a), std::forward<T>(s), std::forward<T>(e),
235 std::forward<T>(so), std::forward<T>(sc), std::forward<T>(sn),
236 std::forward<T>(ao), std::forward<T>(ac), std::forward<T>(ar)};
237 }
238 }
239 #endif
240 #ifndef WILDCARDS_MATCH_HPP
241 #define WILDCARDS_MATCH_HPP
242 #include <stdexcept>
243 #include <type_traits>
244 #include <utility>
245 #ifndef CONFIG_HPP
246 #define CONFIG_HPP
247 #ifndef QUICKCPPLIB_HAS_FEATURE_H
248 #define QUICKCPPLIB_HAS_FEATURE_H
249 #if __cplusplus >= 201103L
250 #if !defined(__cpp_alias_templates)
251 #define __cpp_alias_templates 190000
252 #endif
253 #if !defined(__cpp_attributes)
254 #define __cpp_attributes 190000
255 #endif
256 #if !defined(__cpp_constexpr)
257 #if __cplusplus >= 201402L
258 #define __cpp_constexpr 201304
259 #else
260 #define __cpp_constexpr 190000
261 #endif
262 #endif
263 #if !defined(__cpp_decltype)
264 #define __cpp_decltype 190000
265 #endif
266 #if !defined(__cpp_delegating_constructors)
267 #define __cpp_delegating_constructors 190000
268 #endif
269 #if !defined(__cpp_explicit_conversion)
270 #define __cpp_explicit_conversion 190000
271 #endif
272 #if !defined(__cpp_inheriting_constructors)
273 #define __cpp_inheriting_constructors 190000
274 #endif
275 #if !defined(__cpp_initializer_lists)
276 #define __cpp_initializer_lists 190000
277 #endif
278 #if !defined(__cpp_lambdas)
279 #define __cpp_lambdas 190000
280 #endif
281 #if !defined(__cpp_nsdmi)
282 #define __cpp_nsdmi 190000
283 #endif
284 #if !defined(__cpp_range_based_for)
285 #define __cpp_range_based_for 190000
286 #endif
287 #if !defined(__cpp_raw_strings)
288 #define __cpp_raw_strings 190000
289 #endif
290 #if !defined(__cpp_ref_qualifiers)
291 #define __cpp_ref_qualifiers 190000
292 #endif
293 #if !defined(__cpp_rvalue_references)
294 #define __cpp_rvalue_references 190000
295 #endif
296 #if !defined(__cpp_static_assert)
297 #define __cpp_static_assert 190000
298 #endif
299 #if !defined(__cpp_unicode_characters)
300 #define __cpp_unicode_characters 190000
301 #endif
302 #if !defined(__cpp_unicode_literals)
303 #define __cpp_unicode_literals 190000
304 #endif
305 #if !defined(__cpp_user_defined_literals)
306 #define __cpp_user_defined_literals 190000
307 #endif
308 #if !defined(__cpp_variadic_templates)
309 #define __cpp_variadic_templates 190000
310 #endif
311 #endif
312 #if __cplusplus >= 201402L
313 #if !defined(__cpp_aggregate_nsdmi)
314 #define __cpp_aggregate_nsdmi 190000
315 #endif
316 #if !defined(__cpp_binary_literals)
317 #define __cpp_binary_literals 190000
318 #endif
319 #if !defined(__cpp_decltype_auto)
320 #define __cpp_decltype_auto 190000
321 #endif
322 #if !defined(__cpp_generic_lambdas)
323 #define __cpp_generic_lambdas 190000
324 #endif
325 #if !defined(__cpp_init_captures)
326 #define __cpp_init_captures 190000
327 #endif
328 #if !defined(__cpp_return_type_deduction)
329 #define __cpp_return_type_deduction 190000
330 #endif
331 #if !defined(__cpp_sized_deallocation)
332 #define __cpp_sized_deallocation 190000
333 #endif
334 #if !defined(__cpp_variable_templates)
335 #define __cpp_variable_templates 190000
336 #endif
337 #endif
338 #if defined(_MSC_VER) && !defined(__clang__)
339 #if !defined(__cpp_exceptions) && defined(_CPPUNWIND)
340 #define __cpp_exceptions 190000
341 #endif
342 #if !defined(__cpp_rtti) && defined(_CPPRTTI)
343 #define __cpp_rtti 190000
344 #endif
345 #if !defined(__cpp_alias_templates) && _MSC_VER >= 1800
346 #define __cpp_alias_templates 190000
347 #endif
348 #if !defined(__cpp_attributes)
349 #define __cpp_attributes 190000
350 #endif
351 #if !defined(__cpp_constexpr) && _MSC_FULL_VER >= 190023506
352 #define __cpp_constexpr 190000
353 #endif
354 #if !defined(__cpp_decltype) && _MSC_VER >= 1600
355 #define __cpp_decltype 190000
356 #endif
357 #if !defined(__cpp_delegating_constructors) && _MSC_VER >= 1800
358 #define __cpp_delegating_constructors 190000
359 #endif
360 #if !defined(__cpp_explicit_conversion) && _MSC_VER >= 1800
361 #define __cpp_explicit_conversion 190000
362 #endif
363 #if !defined(__cpp_inheriting_constructors) && _MSC_VER >= 1900
364 #define __cpp_inheriting_constructors 190000
365 #endif
366 #if !defined(__cpp_initializer_lists) && _MSC_VER >= 1900
367 #define __cpp_initializer_lists 190000
368 #endif
369 #if !defined(__cpp_lambdas) && _MSC_VER >= 1600
370 #define __cpp_lambdas 190000
371 #endif
372 #if !defined(__cpp_nsdmi) && _MSC_VER >= 1900
373 #define __cpp_nsdmi 190000
374 #endif
375 #if !defined(__cpp_range_based_for) && _MSC_VER >= 1700
376 #define __cpp_range_based_for 190000
377 #endif
378 #if !defined(__cpp_raw_strings) && _MSC_VER >= 1800
379 #define __cpp_raw_strings 190000
380 #endif
381 #if !defined(__cpp_ref_qualifiers) && _MSC_VER >= 1900
382 #define __cpp_ref_qualifiers 190000
383 #endif
384 #if !defined(__cpp_rvalue_references) && _MSC_VER >= 1600
385 #define __cpp_rvalue_references 190000
386 #endif
387 #if !defined(__cpp_static_assert) && _MSC_VER >= 1600
388 #define __cpp_static_assert 190000
389 #endif
390 #if !defined(__cpp_user_defined_literals) && _MSC_VER >= 1900
391 #define __cpp_user_defined_literals 190000
392 #endif
393 #if !defined(__cpp_variadic_templates) && _MSC_VER >= 1800
394 #define __cpp_variadic_templates 190000
395 #endif
396 #if !defined(__cpp_binary_literals) && _MSC_VER >= 1900
397 #define __cpp_binary_literals 190000
398 #endif
399 #if !defined(__cpp_decltype_auto) && _MSC_VER >= 1900
400 #define __cpp_decltype_auto 190000
401 #endif
402 #if !defined(__cpp_generic_lambdas) && _MSC_VER >= 1900
403 #define __cpp_generic_lambdas 190000
404 #endif
405 #if !defined(__cpp_init_captures) && _MSC_VER >= 1900
406 #define __cpp_init_captures 190000
407 #endif
408 #if !defined(__cpp_return_type_deduction) && _MSC_VER >= 1900
409 #define __cpp_return_type_deduction 190000
410 #endif
411 #if !defined(__cpp_sized_deallocation) && _MSC_VER >= 1900
412 #define __cpp_sized_deallocation 190000
413 #endif
414 #if !defined(__cpp_variable_templates) && _MSC_FULL_VER >= 190023506
415 #define __cpp_variable_templates 190000
416 #endif
417 #endif
418 #if(defined(__GNUC__) && !defined(__clang__))
419 #define QUICKCPPLIB_GCC (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
420 #if !defined(__cpp_exceptions) && defined(__EXCEPTIONS)
421 #define __cpp_exceptions 190000
422 #endif
423 #if !defined(__cpp_rtti) && defined(__GXX_RTTI)
424 #define __cpp_rtti 190000
425 #endif
426 #if defined(__GXX_EXPERIMENTAL_CXX0X__)
427 #if !defined(__cpp_alias_templates) && (QUICKCPPLIB_GCC >= 40700)
428 #define __cpp_alias_templates 190000
429 #endif
430 #if !defined(__cpp_attributes) && (QUICKCPPLIB_GCC >= 40800)
431 #define __cpp_attributes 190000
432 #endif
433 #if !defined(__cpp_constexpr) && (QUICKCPPLIB_GCC >= 40600)
434 #define __cpp_constexpr 190000
435 #endif
436 #if !defined(__cpp_decltype) && (QUICKCPPLIB_GCC >= 40300)
437 #define __cpp_decltype 190000
438 #endif
439 #if !defined(__cpp_delegating_constructors) && (QUICKCPPLIB_GCC >= 40700)
440 #define __cpp_delegating_constructors 190000
441 #endif
442 #if !defined(__cpp_explicit_conversion) && (QUICKCPPLIB_GCC >= 40500)
443 #define __cpp_explicit_conversion 190000
444 #endif
445 #if !defined(__cpp_inheriting_constructors) && (QUICKCPPLIB_GCC >= 40800)
446 #define __cpp_inheriting_constructors 190000
447 #endif
448 #if !defined(__cpp_initializer_lists) && (QUICKCPPLIB_GCC >= 40800)
449 #define __cpp_initializer_lists 190000
450 #endif
451 #if !defined(__cpp_lambdas) && (QUICKCPPLIB_GCC >= 40500)
452 #define __cpp_lambdas 190000
453 #endif
454 #if !defined(__cpp_nsdmi) && (QUICKCPPLIB_GCC >= 40700)
455 #define __cpp_nsdmi 190000
456 #endif
457 #if !defined(__cpp_range_based_for) && (QUICKCPPLIB_GCC >= 40600)
458 #define __cpp_range_based_for 190000
459 #endif
460 #if !defined(__cpp_raw_strings) && (QUICKCPPLIB_GCC >= 40500)
461 #define __cpp_raw_strings 190000
462 #endif
463 #if !defined(__cpp_ref_qualifiers) && (QUICKCPPLIB_GCC >= 40801)
464 #define __cpp_ref_qualifiers 190000
465 #endif
466 #if !defined(__cpp_rvalue_references) && defined(__cpp_rvalue_reference)
467 #define __cpp_rvalue_references __cpp_rvalue_reference
468 #endif
469 #if !defined(__cpp_static_assert) && (QUICKCPPLIB_GCC >= 40300)
470 #define __cpp_static_assert 190000
471 #endif
472 #if !defined(__cpp_unicode_characters) && (QUICKCPPLIB_GCC >= 40500)
473 #define __cpp_unicode_characters 190000
474 #endif
475 #if !defined(__cpp_unicode_literals) && (QUICKCPPLIB_GCC >= 40500)
476 #define __cpp_unicode_literals 190000
477 #endif
478 #if !defined(__cpp_user_defined_literals) && (QUICKCPPLIB_GCC >= 40700)
479 #define __cpp_user_defined_literals 190000
480 #endif
481 #if !defined(__cpp_variadic_templates) && (QUICKCPPLIB_GCC >= 40400)
482 #define __cpp_variadic_templates 190000
483 #endif
484 #endif
485 #endif
486 #if defined(__clang__)
487 #define QUICKCPPLIB_CLANG (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
488 #if !defined(__cpp_exceptions) && (defined(__EXCEPTIONS) || defined(_CPPUNWIND))
489 #define __cpp_exceptions 190000
490 #endif
491 #if !defined(__cpp_rtti) && (defined(__GXX_RTTI) || defined(_CPPRTTI))
492 #define __cpp_rtti 190000
493 #endif
494 #if defined(__GXX_EXPERIMENTAL_CXX0X__)
495 #if !defined(__cpp_alias_templates) && (QUICKCPPLIB_CLANG >= 30000)
496 #define __cpp_alias_templates 190000
497 #endif
498 #if !defined(__cpp_attributes) && (QUICKCPPLIB_CLANG >= 30300)
499 #define __cpp_attributes 190000
500 #endif
501 #if !defined(__cpp_constexpr) && (QUICKCPPLIB_CLANG >= 30100)
502 #define __cpp_constexpr 190000
503 #endif
504 #if !defined(__cpp_decltype) && (QUICKCPPLIB_CLANG >= 20900)
505 #define __cpp_decltype 190000
506 #endif
507 #if !defined(__cpp_delegating_constructors) && (QUICKCPPLIB_CLANG >= 30000)
508 #define __cpp_delegating_constructors 190000
509 #endif
510 #if !defined(__cpp_explicit_conversion) && (QUICKCPPLIB_CLANG >= 30000)
511 #define __cpp_explicit_conversion 190000
512 #endif
513 #if !defined(__cpp_inheriting_constructors) && (QUICKCPPLIB_CLANG >= 30300)
514 #define __cpp_inheriting_constructors 190000
515 #endif
516 #if !defined(__cpp_initializer_lists) && (QUICKCPPLIB_CLANG >= 30100)
517 #define __cpp_initializer_lists 190000
518 #endif
519 #if !defined(__cpp_lambdas) && (QUICKCPPLIB_CLANG >= 30100)
520 #define __cpp_lambdas 190000
521 #endif
522 #if !defined(__cpp_nsdmi) && (QUICKCPPLIB_CLANG >= 30000)
523 #define __cpp_nsdmi 190000
524 #endif
525 #if !defined(__cpp_range_based_for) && (QUICKCPPLIB_CLANG >= 30000)
526 #define __cpp_range_based_for 190000
527 #endif
528 #if !defined(__cpp_raw_strings) && defined(__cpp_raw_string_literals)
529 #define __cpp_raw_strings __cpp_raw_string_literals
530 #endif
531 #if !defined(__cpp_raw_strings) && (QUICKCPPLIB_CLANG >= 30000)
532 #define __cpp_raw_strings 190000
533 #endif
534 #if !defined(__cpp_ref_qualifiers) && (QUICKCPPLIB_CLANG >= 20900)
535 #define __cpp_ref_qualifiers 190000
536 #endif
537 #if !defined(__cpp_rvalue_references) && defined(__cpp_rvalue_reference)
538 #define __cpp_rvalue_references __cpp_rvalue_reference
539 #endif
540 #if !defined(__cpp_rvalue_references) && (QUICKCPPLIB_CLANG >= 20900)
541 #define __cpp_rvalue_references 190000
542 #endif
543 #if !defined(__cpp_static_assert) && (QUICKCPPLIB_CLANG >= 20900)
544 #define __cpp_static_assert 190000
545 #endif
546 #if !defined(__cpp_unicode_characters) && (QUICKCPPLIB_CLANG >= 30000)
547 #define __cpp_unicode_characters 190000
548 #endif
549 #if !defined(__cpp_unicode_literals) && (QUICKCPPLIB_CLANG >= 30000)
550 #define __cpp_unicode_literals 190000
551 #endif
552 #if !defined(__cpp_user_defined_literals) && defined(__cpp_user_literals)
553 #define __cpp_user_defined_literals __cpp_user_literals
554 #endif
555 #if !defined(__cpp_user_defined_literals) && (QUICKCPPLIB_CLANG >= 30100)
556 #define __cpp_user_defined_literals 190000
557 #endif
558 #if !defined(__cpp_variadic_templates) && (QUICKCPPLIB_CLANG >= 20900)
559 #define __cpp_variadic_templates 190000
560 #endif
561 #endif
562 #endif
563 #endif
564 #define cfg_HAS_CONSTEXPR14 (__cpp_constexpr >= 201304)
565 #if cfg_HAS_CONSTEXPR14
566 #define cfg_constexpr14 constexpr
567 #else
568 #define cfg_constexpr14
569 #endif
570 #if cfg_HAS_CONSTEXPR14 && defined(__clang__)
571 #define cfg_HAS_FULL_FEATURED_CONSTEXPR14 1
572 #else
573 #define cfg_HAS_FULL_FEATURED_CONSTEXPR14 0
574 #endif
575 #endif
576 #ifndef CX_FUNCTIONAL_HPP
577 #define CX_FUNCTIONAL_HPP
578 #include <utility>
579 namespace cx
580 {
581 template <typename T>
582 struct less
583 {
584 constexpr auto operator()(const T& lhs, const T& rhs) const -> decltype(lhs < rhs)
585 {
586 return lhs < rhs;
587 }
588 };
589 template <>
590 struct less<void>
591 {
592 template <typename T, typename U>
593 constexpr auto operator()(T&& lhs, U&& rhs) const
594 -> decltype(std::forward<T>(lhs) < std::forward<U>(rhs))
595 {
596 return std::forward<T>(lhs) < std::forward<U>(rhs);
597 }
598 };
599 template <typename T>
600 struct equal_to
601 {
602 constexpr auto operator()(const T& lhs, const T& rhs) const -> decltype(lhs == rhs)
603 {
604 return lhs == rhs;
605 }
606 };
607 template <>
608 struct equal_to<void>
609 {
610 template <typename T, typename U>
611 constexpr auto operator()(T&& lhs, U&& rhs) const
612 -> decltype(std::forward<T>(lhs) == std::forward<U>(rhs))
613 {
614 return std::forward<T>(lhs) == std::forward<U>(rhs);
615 }
616 };
617 }
618 #endif
619 #ifndef CX_ITERATOR_HPP
620 #define CX_ITERATOR_HPP
621 #include <cstddef>
622 #include <initializer_list>
623 namespace cx
624 {
625 template <typename It>
626 constexpr It next(It it)
627 {
628 return it + 1;
629 }
630 template <typename It>
631 constexpr It prev(It it)
632 {
633 return it - 1;
634 }
635 template <typename C>
636 constexpr auto size(const C& c) -> decltype(c.size())
637 {
638 return c.size();
639 }
640 template <typename T, std::size_t N>
641 constexpr std::size_t size(const T (&)[N])
642 {
643 return N;
644 }
645 template <typename C>
646 constexpr auto empty(const C& c) -> decltype(c.empty())
647 {
648 return c.empty();
649 }
650 template <typename T, std::size_t N>
651 constexpr bool empty(const T (&)[N])
652 {
653 return false;
654 }
655 template <typename E>
656 constexpr bool empty(std::initializer_list<E> il)
657 {
658 return il.size() == 0;
659 }
660 template <typename C>
661 constexpr auto begin(const C& c) -> decltype(c.begin())
662 {
663 return c.begin();
664 }
665 template <typename C>
666 constexpr auto begin(C& c) -> decltype(c.begin())
667 {
668 return c.begin();
669 }
670 template <typename T, std::size_t N>
671 constexpr T* begin(T (&array)[N])
672 {
673 return &array[0];
674 }
675 template <typename E>
676 constexpr const E* begin(std::initializer_list<E> il)
677 {
678 return il.begin();
679 }
680 template <typename C>
681 constexpr auto cbegin(const C& c) -> decltype(cx::begin(c))
682 {
683 return cx::begin(c);
684 }
685 template <typename C>
686 constexpr auto end(const C& c) -> decltype(c.end())
687 {
688 return c.end();
689 }
690 template <typename C>
691 constexpr auto end(C& c) -> decltype(c.end())
692 {
693 return c.end();
694 }
695 template <typename T, std::size_t N>
696 constexpr T* end(T (&array)[N])
697 {
698 return &array[N];
699 }
700 template <typename E>
701 constexpr const E* end(std::initializer_list<E> il)
702 {
703 return il.end();
704 }
705 template <typename C>
706 constexpr auto cend(const C& c) -> decltype(cx::end(c))
707 {
708 return cx::end(c);
709 }
710 }
711 #endif
712 #ifndef WILDCARDS_UTILITY_HPP
713 #define WILDCARDS_UTILITY_HPP
714 #include <type_traits>
715 #include <utility>
716 namespace wildcards
717 {
718 template <typename C>
720 {
721 using type = typename std::remove_cv<
722 typename std::remove_reference<decltype(cx::cbegin(std::declval<C>()))>::type>::type;
723 };
724 template <typename C>
726 template <typename C>
727 struct iterator
728 {
729 using type = typename std::remove_cv<
730 typename std::remove_reference<decltype(cx::begin(std::declval<C>()))>::type>::type;
731 };
732 template <typename C>
733 using iterator_t = typename iterator<C>::type;
734 template <typename It>
736 {
737 using type = typename std::remove_cv<
738 typename std::remove_reference<decltype(*std::declval<It>())>::type>::type;
739 };
740 template <typename It>
742 template <typename C>
744 {
745 using type = typename std::remove_cv<
746 typename std::remove_reference<decltype(*cx::begin(std::declval<C>()))>::type>::type;
747 };
748 template <typename C>
750 }
751 #endif
752 namespace wildcards
753 {
754 template <typename SequenceIterator, typename PatternIterator>
756 {
757 bool res;
758 SequenceIterator s, send, s1;
759 PatternIterator p, pend, p1;
760 constexpr operator bool() const
761 {
762 return res;
763 }
764 };
765 namespace detail
766 {
767 template <typename SequenceIterator, typename PatternIterator>
769 {
770 bool res;
771 SequenceIterator s;
772 PatternIterator p;
773 constexpr operator bool() const
774 {
775 return res;
776 }
777 };
778 template <typename SequenceIterator, typename PatternIterator>
780 SequenceIterator s,
781 PatternIterator p)
782 {
783 return {std::move(res), std::move(s), std::move(p)};
784 }
785 template <typename SequenceIterator, typename PatternIterator>
787 SequenceIterator s, SequenceIterator send, PatternIterator p, PatternIterator pend,
789 {
790 return {std::move(mr.res), std::move(s), std::move(send), std::move(mr.s),
791 std::move(p), std::move(pend), std::move(mr.p)};
792 }
793 #if !cfg_HAS_FULL_FEATURED_CONSTEXPR14
794 constexpr bool throw_invalid_argument(const char* what_arg)
795 {
796 return what_arg == nullptr ? false : throw std::invalid_argument(what_arg);
797 }
798 template <typename T>
799 constexpr T throw_invalid_argument(T t, const char* what_arg)
800 {
801 return what_arg == nullptr ? t : throw std::invalid_argument(what_arg);
802 }
803 constexpr bool throw_logic_error(const char* what_arg)
804 {
805 return what_arg == nullptr ? false : throw std::logic_error(what_arg);
806 }
807 template <typename T>
808 constexpr T throw_logic_error(T t, const char* what_arg)
809 {
810 return what_arg == nullptr ? t : throw std::logic_error(what_arg);
811 }
812 #endif
813 enum class is_set_state
814 {
815 open,
817 first,
818 next
819 };
820 template <typename PatternIterator>
821 constexpr bool is_set(
822 PatternIterator p, PatternIterator pend,
825 {
826 #if cfg_HAS_CONSTEXPR14
827 if (!c.set_enabled)
828 {
829 return false;
830 }
831 while (p != pend)
832 {
833 switch (state)
834 {
835 case is_set_state::open:
836 if (*p != c.set_open)
837 {
838 return false;
839 }
841 break;
843 if (*p == c.set_not)
844 {
845 state = is_set_state::first;
846 }
847 else
848 {
849 state = is_set_state::next;
850 }
851 break;
853 state = is_set_state::next;
854 break;
855 case is_set_state::next:
856 if (*p == c.set_close)
857 {
858 return true;
859 }
860 break;
861 default:
862 #if cfg_HAS_FULL_FEATURED_CONSTEXPR14
863 throw std::logic_error(
864 "The program execution should never end up here throwing this exception");
865 #else
866 return throw_logic_error(
867 "The program execution should never end up here throwing this exception");
868 #endif
869 }
870 p = cx::next(p);
871 }
872 return false;
873 #else
874 return c.set_enabled && p != pend &&
875 (state == is_set_state::open
876 ? *p == c.set_open && is_set(cx::next(p), pend, c, is_set_state::not_or_first)
877 :
879 ? *p == c.set_not ? is_set(cx::next(p), pend, c, is_set_state::first)
880 : is_set(cx::next(p), pend, c, is_set_state::next)
881 : state == is_set_state::first
882 ? is_set(cx::next(p), pend, c, is_set_state::next)
883 : state == is_set_state::next
884 ? *p == c.set_close ||
886 : throw std::logic_error("The program execution should never end up "
887 "here throwing this exception"));
888 #endif
889 }
890 enum class set_end_state
891 {
892 open,
894 first,
895 next
896 };
897 template <typename PatternIterator>
898 constexpr PatternIterator set_end(
899 PatternIterator p, PatternIterator pend,
902 {
903 #if cfg_HAS_CONSTEXPR14
904 if (!c.set_enabled)
905 {
906 #if cfg_HAS_FULL_FEATURED_CONSTEXPR14
907 throw std::invalid_argument("The use of sets is disabled");
908 #else
909 return throw_invalid_argument(p, "The use of sets is disabled");
910 #endif
911 }
912 while (p != pend)
913 {
914 switch (state)
915 {
917 if (*p != c.set_open)
918 {
919 #if cfg_HAS_FULL_FEATURED_CONSTEXPR14
920 throw std::invalid_argument("The given pattern is not a valid set");
921 #else
922 return throw_invalid_argument(p, "The given pattern is not a valid set");
923 #endif
924 }
926 break;
928 if (*p == c.set_not)
929 {
930 state = set_end_state::first;
931 }
932 else
933 {
934 state = set_end_state::next;
935 }
936 break;
938 state = set_end_state::next;
939 break;
941 if (*p == c.set_close)
942 {
943 return cx::next(p);
944 }
945 break;
946 default:
947 #if cfg_HAS_FULL_FEATURED_CONSTEXPR14
948 throw std::logic_error(
949 "The program execution should never end up here throwing this exception");
950 #else
951 return throw_logic_error(
952 p, "The program execution should never end up here throwing this exception");
953 #endif
954 }
955 p = cx::next(p);
956 }
957 #if cfg_HAS_FULL_FEATURED_CONSTEXPR14
958 throw std::invalid_argument("The given pattern is not a valid set");
959 #else
960 return throw_invalid_argument(p, "The given pattern is not a valid set");
961 #endif
962 #else
963 return !c.set_enabled
964 ? throw std::invalid_argument("The use of sets is disabled")
965 : p == pend
966 ? throw std::invalid_argument("The given pattern is not a valid set")
967 :
968 state == set_end_state::open
969 ? *p == c.set_open
971 : throw std::invalid_argument("The given pattern is not a valid set")
972 :
974 ? *p == c.set_not ? set_end(cx::next(p), pend, c, set_end_state::first)
976 : state == set_end_state::first
978 : state == set_end_state::next
979 ? *p == c.set_close
980 ? cx::next(p)
982 : throw std::logic_error(
983 "The program execution should never end up "
984 "here throwing this exception");
985 #endif
986 }
987 enum class match_set_state
988 {
989 open,
991 first_out,
992 next_in,
993 next_out
994 };
995 template <typename SequenceIterator, typename PatternIterator,
996 typename EqualTo = cx::equal_to<void>>
998 SequenceIterator s, SequenceIterator send, PatternIterator p, PatternIterator pend,
1000 const EqualTo& equal_to = EqualTo(), match_set_state state = match_set_state::open)
1001 {
1002 #if cfg_HAS_CONSTEXPR14
1003 if (!c.set_enabled)
1004 {
1005 #if cfg_HAS_FULL_FEATURED_CONSTEXPR14
1006 throw std::invalid_argument("The use of sets is disabled");
1007 #else
1008 return throw_invalid_argument(make_match_result(false, s, p), "The use of sets is disabled");
1009 #endif
1010 }
1011 while (p != pend)
1012 {
1013 switch (state)
1014 {
1016 if (*p != c.set_open)
1017 {
1018 #if cfg_HAS_FULL_FEATURED_CONSTEXPR14
1019 throw std::invalid_argument("The given pattern is not a valid set");
1020 #else
1021 return throw_invalid_argument(make_match_result(false, s, p),
1022 "The given pattern is not a valid set");
1023 #endif
1024 }
1026 break;
1028 if (*p == c.set_not)
1029 {
1031 }
1032 else
1033 {
1034 if (s == send)
1035 {
1036 return make_match_result(false, s, p);
1037 }
1038 if (equal_to(*s, *p))
1039 {
1040 return make_match_result(true, s, p);
1041 }
1042 state = match_set_state::next_in;
1043 }
1044 break;
1046 if (s == send || equal_to(*s, *p))
1047 {
1048 return make_match_result(false, s, p);
1049 }
1051 break;
1053 if (*p == c.set_close || s == send)
1054 {
1055 return make_match_result(false, s, p);
1056 }
1057 if (equal_to(*s, *p))
1058 {
1059 return make_match_result(true, s, p);
1060 }
1061 break;
1063 if (*p == c.set_close)
1064 {
1065 return make_match_result(true, s, p);
1066 }
1067 if (s == send || equal_to(*s, *p))
1068 {
1069 return make_match_result(false, s, p);
1070 }
1071 break;
1072 default:
1073 #if cfg_HAS_FULL_FEATURED_CONSTEXPR14
1074 throw std::logic_error(
1075 "The program execution should never end up here throwing this exception");
1076 #else
1077 return throw_logic_error(
1078 make_match_result(false, s, p),
1079 "The program execution should never end up here throwing this exception");
1080 #endif
1081 }
1082 p = cx::next(p);
1083 }
1084 #if cfg_HAS_FULL_FEATURED_CONSTEXPR14
1085 throw std::invalid_argument("The given pattern is not a valid set");
1086 #else
1087 return throw_invalid_argument(make_match_result(false, s, p),
1088 "The given pattern is not a valid set");
1089 #endif
1090 #else
1091 return !c.set_enabled
1092 ? throw std::invalid_argument("The use of sets is disabled")
1093 : p == pend
1094 ? throw std::invalid_argument("The given pattern is not a valid set")
1095 : state == match_set_state::open
1096 ? *p == c.set_open
1097 ? match_set(s, send, cx::next(p), pend, c, equal_to,
1099 :
1100 throw std::invalid_argument("The given pattern is not a valid set")
1101 :
1103 ? *p == c.set_not
1104 ? match_set(s, send, cx::next(p), pend, c, equal_to,
1106 :
1107 s == send ? make_match_result(false, s, p)
1108 : equal_to(*s, *p)
1109 ? make_match_result(true, s, p)
1110 : match_set(s, send, cx::next(p), pend, c,
1111 equal_to, match_set_state::next_in)
1112 :
1114 ? s == send || equal_to(*s, *p)
1115 ? make_match_result(false, s, p)
1116 : match_set(s, send, cx::next(p), pend, c, equal_to,
1118 :
1119 state == match_set_state::next_in
1120 ? *p == c.set_close || s == send
1121 ? make_match_result(false, s, p)
1122 : equal_to(*s, *p) ? make_match_result(true, s, p)
1123 : match_set(s, send, cx::next(p),
1124 pend, c, equal_to, state)
1125 :
1127 ? *p == c.set_close
1128 ? make_match_result(true, s, p)
1129 : s == send || equal_to(*s, *p)
1130 ? make_match_result(false, s, p)
1131 : match_set(s, send, cx::next(p), pend, c,
1132 equal_to, state)
1133 : throw std::logic_error(
1134 "The program execution should never end up "
1135 "here "
1136 "throwing this exception");
1137 #endif
1138 }
1139 enum class is_alt_state
1140 {
1141 open,
1142 next,
1143 escape
1144 };
1145 template <typename PatternIterator>
1146 constexpr bool is_alt(
1147 PatternIterator p, PatternIterator pend,
1149 is_alt_state state = is_alt_state::open, int depth = 0)
1150 {
1151 #if cfg_HAS_CONSTEXPR14
1152 if (!c.alt_enabled)
1153 {
1154 return false;
1155 }
1156 while (p != pend)
1157 {
1158 switch (state)
1159 {
1160 case is_alt_state::open:
1161 if (*p != c.alt_open)
1162 {
1163 return false;
1164 }
1165 state = is_alt_state::next;
1166 ++depth;
1167 break;
1168 case is_alt_state::next:
1169 if (*p == c.escape)
1170 {
1171 state = is_alt_state::escape;
1172 }
1173 else if (c.set_enabled && *p == c.set_open &&
1175 {
1177 }
1178 else if (*p == c.alt_open)
1179 {
1180 ++depth;
1181 }
1182 else if (*p == c.alt_close)
1183 {
1184 --depth;
1185 if (depth == 0)
1186 {
1187 return true;
1188 }
1189 }
1190 break;
1192 state = is_alt_state::next;
1193 break;
1194 default:
1195 
1196 throw std::logic_error(
1197 "The program execution should never end up here throwing this exception");
1198 
1199 }
1200 p = cx::next(p);
1201 }
1202 return false;
1203 #else
1204 return c.alt_enabled && p != pend &&
1205 (state == is_alt_state::open
1206 ? *p == c.alt_open && is_alt(cx::next(p), pend, c, is_alt_state::next, depth + 1)
1207 : state == is_alt_state::next
1208 ? *p == c.escape
1209 ? is_alt(cx::next(p), pend, c, is_alt_state::escape, depth)
1210 : c.set_enabled && *p == c.set_open &&
1213 pend, c, state, depth)
1214 : *p == c.alt_open
1215 ? is_alt(cx::next(p), pend, c, state, depth + 1)
1216 : *p == c.alt_close
1217 ? depth == 1 ||
1218 is_alt(cx::next(p), pend, c, state, depth - 1)
1219 : is_alt(cx::next(p), pend, c, state, depth)
1220 :
1221 state == is_alt_state::escape
1222 ? is_alt(cx::next(p), pend, c, is_alt_state::next, depth)
1223 : throw std::logic_error(
1224 "The program execution should never end up here throwing this "
1225 "exception"));
1226 #endif
1227 }
1228 enum class alt_end_state
1229 {
1230 open,
1231 next,
1232 escape
1233 };
1234 template <typename PatternIterator>
1235 constexpr PatternIterator alt_end(
1236 PatternIterator p, PatternIterator pend,
1238 alt_end_state state = alt_end_state::open, int depth = 0)
1239 {
1240 #if cfg_HAS_CONSTEXPR14
1241 if (!c.alt_enabled)
1242 {
1243 #if cfg_HAS_FULL_FEATURED_CONSTEXPR14
1244 throw std::invalid_argument("The use of alternatives is disabled");
1245 #else
1246 return throw_invalid_argument(p, "The use of alternatives is disabled");
1247 #endif
1248 }
1249 while (p != pend)
1250 {
1251 switch (state)
1252 {
1253 case alt_end_state::open:
1254 if (*p != c.alt_open)
1255 {
1256 #if cfg_HAS_FULL_FEATURED_CONSTEXPR14
1257 throw std::invalid_argument("The given pattern is not a valid alternative");
1258 #else
1259 return throw_invalid_argument(p, "The given pattern is not a valid alternative");
1260 #endif
1261 }
1262 state = alt_end_state::next;
1263 ++depth;
1264 break;
1265 case alt_end_state::next:
1266 if (*p == c.escape)
1267 {
1268 state = alt_end_state::escape;
1269 }
1270 else if (c.set_enabled && *p == c.set_open &&
1272 {
1274 }
1275 else if (*p == c.alt_open)
1276 {
1277 ++depth;
1278 }
1279 else if (*p == c.alt_close)
1280 {
1281 --depth;
1282 if (depth == 0)
1283 {
1284 return cx::next(p);
1285 }
1286 }
1287 break;
1289 state = alt_end_state::next;
1290 break;
1291 default:
1292 #if cfg_HAS_FULL_FEATURED_CONSTEXPR14
1293 throw std::logic_error(
1294 "The program execution should never end up here throwing this exception");
1295 #else
1296 return throw_logic_error(
1297 p, "The program execution should never end up here throwing this exception");
1298 #endif
1299 }
1300 p = cx::next(p);
1301 }
1302 #if cfg_HAS_FULL_FEATURED_CONSTEXPR14
1303 throw std::invalid_argument("The given pattern is not a valid alternative");
1304 #else
1305 return throw_invalid_argument(p, "The given pattern is not a valid alternative");
1306 #endif
1307 #else
1308 return !c.alt_enabled
1309 ? throw std::invalid_argument("The use of alternatives is disabled")
1310 : p == pend
1311 ? throw std::invalid_argument("The given pattern is not a valid alternative")
1312 : state == alt_end_state::open
1313 ? *p == c.alt_open
1314 ? alt_end(cx::next(p), pend, c, alt_end_state::next, depth + 1)
1315 : throw std::invalid_argument(
1316 "The given pattern is not a valid alternative")
1317 : state == alt_end_state::next
1318 ? *p == c.escape
1319 ? alt_end(cx::next(p), pend, c, alt_end_state::escape, depth)
1320 : c.set_enabled && *p == c.set_open &&
1321 is_set(cx::next(p), pend, c,
1323 ? alt_end(set_end(cx::next(p), pend, c,
1325 pend, c, state, depth)
1326 : *p == c.alt_open
1327 ? alt_end(cx::next(p), pend, c, state, depth + 1)
1328 : *p == c.alt_close
1329 ? depth == 1 ? cx::next(p)
1330 : alt_end(cx::next(p), pend, c,
1331 state, depth - 1)
1332 : alt_end(cx::next(p), pend, c, state, depth)
1333 :
1334 state == alt_end_state::escape
1335 ? alt_end(cx::next(p), pend, c, alt_end_state::next, depth)
1336 : throw std::logic_error(
1337 "The program execution should never end up here throwing "
1338 "this "
1339 "exception");
1340 #endif
1341 }
1343 {
1344 next,
1345 escape
1346 };
1347 template <typename PatternIterator>
1348 constexpr PatternIterator alt_sub_end(
1349 PatternIterator p, PatternIterator pend,
1351 alt_sub_end_state state = alt_sub_end_state::next, int depth = 1)
1352 {
1353 #if cfg_HAS_CONSTEXPR14
1354 if (!c.alt_enabled)
1355 {
1356 #if cfg_HAS_FULL_FEATURED_CONSTEXPR14
1357 throw std::invalid_argument("The use of alternatives is disabled");
1358 #else
1359 return throw_invalid_argument(p, "The use of alternatives is disabled");
1360 #endif
1361 }
1362 while (p != pend)
1363 {
1364 switch (state)
1365 {
1367 if (*p == c.escape)
1368 {
1370 }
1371 else if (c.set_enabled && *p == c.set_open &&
1373 {
1375 }
1376 else if (*p == c.alt_open)
1377 {
1378 ++depth;
1379 }
1380 else if (*p == c.alt_close)
1381 {
1382 --depth;
1383 if (depth == 0)
1384 {
1385 return p;
1386 }
1387 }
1388 else if (*p == c.alt_or)
1389 {
1390 if (depth == 1)
1391 {
1392 return p;
1393 }
1394 }
1395 break;
1397 state = alt_sub_end_state::next;
1398 break;
1399 default:
1400 #if cfg_HAS_FULL_FEATURED_CONSTEXPR14
1401 throw std::logic_error(
1402 "The program execution should never end up here throwing this exception");
1403 #else
1404 return throw_logic_error(
1405 p, "The program execution should never end up here throwing this exception");
1406 #endif
1407 }
1408 p = cx::next(p);
1409 }
1410 #if cfg_HAS_FULL_FEATURED_CONSTEXPR14
1411 throw std::invalid_argument("The given pattern is not a valid alternative");
1412 #else
1413 return throw_invalid_argument(p, "The given pattern is not a valid alternative");
1414 #endif
1415 #else
1416 return !c.alt_enabled
1417 ? throw std::invalid_argument("The use of alternatives is disabled")
1418 : p == pend
1419 ? throw std::invalid_argument("The given pattern is not a valid alternative")
1420 : state == alt_sub_end_state::next
1421 ? *p == c.escape
1422 ? alt_sub_end(cx::next(p), pend, c, alt_sub_end_state::escape, depth)
1423 : c.set_enabled && *p == c.set_open &&
1425 ? alt_sub_end(set_end(cx::next(p), pend, c,
1427 pend, c, state, depth)
1428 : *p == c.alt_open
1429 ? alt_sub_end(cx::next(p), pend, c, state, depth + 1)
1430 : *p == c.alt_close
1431 ? depth == 1 ? p : alt_sub_end(cx::next(p), pend,
1432 c, state, depth - 1)
1433 : *p == c.alt_or
1434 ? depth == 1 ? p
1435 : alt_sub_end(cx::next(p), pend,
1436 c, state, depth)
1437 : alt_sub_end(cx::next(p), pend, c, state,
1438 depth)
1439 :
1441 ? alt_sub_end(cx::next(p), pend, c, alt_sub_end_state::next, depth)
1442 : throw std::logic_error(
1443 "The program execution should never end up here throwing "
1444 "this "
1445 "exception");
1446 #endif
1447 }
1448 template <typename SequenceIterator, typename PatternIterator,
1449 typename EqualTo = cx::equal_to<void>>
1450 constexpr match_result<SequenceIterator, PatternIterator> match(
1451 SequenceIterator s, SequenceIterator send, PatternIterator p, PatternIterator pend,
1453 const EqualTo& equal_to = EqualTo(), bool partial = false, bool escape = false);
1454 template <typename SequenceIterator, typename PatternIterator,
1455 typename EqualTo = cx::equal_to<void>>
1457 SequenceIterator s, SequenceIterator send, PatternIterator p1, PatternIterator p1end,
1458 PatternIterator p2, PatternIterator p2end,
1460 const EqualTo& equal_to = EqualTo(), bool partial = false)
1461 {
1462 #if cfg_HAS_CONSTEXPR14
1463 auto result1 = match(s, send, p1, p1end, c, equal_to, true);
1464 if (result1)
1465 {
1466 auto result2 = match(result1.s, send, p2, p2end, c, equal_to, partial);
1467 if (result2)
1468 {
1469 return result2;
1470 }
1471 }
1472 p1 = cx::next(p1end);
1473 if (p1 == p2)
1474 {
1475 return make_match_result(false, s, p1end);
1476 }
1477 return match_alt(s, send, p1, alt_sub_end(p1, p2, c), p2, p2end, c, equal_to, partial);
1478 #else
1479 return match(s, send, p1, p1end, c, equal_to, true) &&
1480 match(match(s, send, p1, p1end, c, equal_to, true).s, send, p2, p2end, c, equal_to,
1481 partial)
1482 ? match(match(s, send, p1, p1end, c, equal_to, true).s, send, p2, p2end, c, equal_to,
1483 partial)
1484 : cx::next(p1end) == p2
1485 ? make_match_result(false, s, p1end)
1486 : match_alt(s, send, cx::next(p1end), alt_sub_end(cx::next(p1end), p2, c), p2,
1487 p2end, c, equal_to, partial);
1488 #endif
1489 }
1490 template <typename SequenceIterator, typename PatternIterator, typename EqualTo>
1492 SequenceIterator s, SequenceIterator send, PatternIterator p, PatternIterator pend,
1493 const cards<iterated_item_t<PatternIterator>>& c, const EqualTo& equal_to, bool partial,
1494 bool escape)
1495 {
1496 #if cfg_HAS_CONSTEXPR14
1497 if (p == pend)
1498 {
1499 return make_match_result(partial || s == send, s, p);
1500 }
1501 if (escape)
1502 {
1503 if (s == send || !equal_to(*s, *p))
1504 {
1505 return make_match_result(false, s, p);
1506 }
1507 return match(cx::next(s), send, cx::next(p), pend, c, equal_to, partial);
1508 }
1509 if (*p == c.anything)
1510 {
1511 auto result = match(s, send, cx::next(p), pend, c, equal_to, partial);
1512 if (result)
1513 {
1514 return result;
1515 }
1516 if (s == send)
1517 {
1518 return make_match_result(false, s, p);
1519 }
1520 return match(cx::next(s), send, p, pend, c, equal_to, partial);
1521 }
1522 if (*p == c.single)
1523 {
1524 if (s == send)
1525 {
1526 return make_match_result(false, s, p);
1527 }
1528 return match(cx::next(s), send, cx::next(p), pend, c, equal_to, partial);
1529 }
1530 if (*p == c.escape)
1531 {
1532 return match(s, send, cx::next(p), pend, c, equal_to, partial, true);
1533 }
1534 if (c.set_enabled && *p == c.set_open && is_set(cx::next(p), pend, c, is_set_state::not_or_first))
1535 {
1536 auto result =
1537 match_set(s, send, cx::next(p), pend, c, equal_to, match_set_state::not_or_first_in);
1538 if (!result)
1539 {
1540 return result;
1541 }
1542 return match(cx::next(s), send, set_end(cx::next(p), pend, c, set_end_state::not_or_first),
1543 pend, c, equal_to, partial);
1544 }
1545 if (c.alt_enabled && *p == c.alt_open && is_alt(cx::next(p), pend, c, is_alt_state::next, 1))
1546 {
1547 auto p_alt_end = alt_end(cx::next(p), pend, c, alt_end_state::next, 1);
1548 return match_alt(s, send, cx::next(p), alt_sub_end(cx::next(p), p_alt_end, c), p_alt_end, pend,
1549 c, equal_to, partial);
1550 }
1551 if (s == send || !equal_to(*s, *p))
1552 {
1553 return make_match_result(false, s, p);
1554 }
1555 return match(cx::next(s), send, cx::next(p), pend, c, equal_to, partial);
1556 #else
1557 return p == pend
1558 ? make_match_result(partial || s == send, s, p)
1559 : escape
1560 ? s == send || !equal_to(*s, *p)
1561 ? make_match_result(false, s, p)
1562 : match(cx::next(s), send, cx::next(p), pend, c, equal_to, partial)
1563 : *p == c.anything
1564 ? match(s, send, cx::next(p), pend, c, equal_to, partial)
1565 ? match(s, send, cx::next(p), pend, c, equal_to, partial)
1566 : s == send ? make_match_result(false, s, p)
1567 : match(cx::next(s), send, p, pend, c, equal_to, partial)
1568 : *p == c.single
1569 ? s == send ? make_match_result(false, s, p)
1570 : match(cx::next(s), send, cx::next(p), pend, c,
1571 equal_to, partial)
1572 : *p == c.escape
1573 ? match(s, send, cx::next(p), pend, c, equal_to, partial, true)
1574 : c.set_enabled && *p == c.set_open &&
1575 is_set(cx::next(p), pend, c,
1577 ? !match_set(s, send, cx::next(p), pend, c, equal_to,
1579 ? match_set(s, send, cx::next(p), pend, c,
1580 equal_to,
1582 : match(cx::next(s), send,
1583 set_end(cx::next(p), pend, c,
1585 pend, c, equal_to, partial)
1586 : c.alt_enabled && *p == c.alt_open &&
1587 is_alt(cx::next(p), pend, c,
1589 ? match_alt(
1590 s, send, cx::next(p),
1592 alt_end(cx::next(p), pend, c,
1594 c),
1595 alt_end(cx::next(p), pend, c,
1597 pend, c, equal_to, partial)
1598 : s == send || !equal_to(*s, *p)
1599 ? make_match_result(false, s, p)
1600 : match(cx::next(s), send, cx::next(p), pend,
1601 c, equal_to, partial);
1602 #endif
1603 }
1604 }
1605 template <typename Sequence, typename Pattern, typename EqualTo = cx::equal_to<void>>
1607 Sequence&& sequence, Pattern&& pattern,
1609 const EqualTo& equal_to = EqualTo())
1610 {
1612 cx::cbegin(sequence), cx::cend(sequence), cx::cbegin(pattern), cx::cend(pattern),
1613 detail::match(cx::cbegin(sequence), cx::cend(std::forward<Sequence>(sequence)),
1614 cx::cbegin(pattern), cx::cend(std::forward<Pattern>(pattern)), c, equal_to));
1615 }
1616 template <typename Sequence, typename Pattern, typename EqualTo = cx::equal_to<void>,
1617 typename = typename std::enable_if<!std::is_same<EqualTo, cards_type>::value>::type>
1619 Sequence&& sequence, Pattern&& pattern, const EqualTo& equal_to)
1620 {
1621 return match(std::forward<Sequence>(sequence), std::forward<Pattern>(pattern),
1622 cards<container_item_t<Pattern>>(), equal_to);
1623 }
1624 }
1625 #endif
1626 #ifndef WILDCARDS_MATCHER_HPP
1627 #define WILDCARDS_MATCHER_HPP
1628 #include <cstddef>
1629 #include <type_traits>
1630 #include <utility>
1631 #ifndef CX_STRING_VIEW_HPP
1632 #define CX_STRING_VIEW_HPP
1633 #include <cstddef>
1634 #include <ostream>
1635 #ifndef CX_ALGORITHM_HPP
1636 #define CX_ALGORITHM_HPP
1637 namespace cx
1638 {
1639 template <typename Iterator1, typename Iterator2>
1640 constexpr bool equal(Iterator1 first1, Iterator1 last1, Iterator2 first2, Iterator2 last2)
1641 {
1642 #if cfg_HAS_CONSTEXPR14
1643 while (first1 != last1 && first2 != last2 && *first1 == *first2)
1644 {
1645 ++first1, ++first2;
1646 }
1647 return first1 == last1 && first2 == last2;
1648 #else
1649 return first1 != last1 && first2 != last2 && *first1 == *first2
1650 ? equal(first1 + 1, last1, first2 + 1, last2)
1651 : first1 == last1 && first2 == last2;
1652 #endif
1653 }
1654 }
1655 #endif
1656 namespace cx
1657 {
1658 template <typename T>
1660 {
1661 public:
1662 using value_type = T;
1663 constexpr basic_string_view() = default;
1664 template <std::size_t N>
1665 constexpr basic_string_view(const T (&str)[N]) : data_{&str[0]}, size_{N - 1}
1666 {
1667 }
1668 constexpr basic_string_view(const T* str, std::size_t s) : data_{str}, size_{s}
1669 {
1670 }
1671 constexpr const T* data() const
1672 {
1673 return data_;
1674 }
1675 constexpr std::size_t size() const
1676 {
1677 return size_;
1678 }
1679 constexpr bool empty() const
1680 {
1681 return size() == 0;
1682 }
1683 constexpr const T* begin() const
1684 {
1685 return data_;
1686 }
1687 constexpr const T* cbegin() const
1688 {
1689 return begin();
1690 }
1691 constexpr const T* end() const
1692 {
1693 return data_ + size_;
1694 }
1695 constexpr const T* cend() const
1696 {
1697 return end();
1698 }
1699 private:
1700 const T* data_{nullptr};
1701 std::size_t size_{0};
1702 };
1703 template <typename T>
1704 constexpr bool operator==(const basic_string_view<T>& lhs, const basic_string_view<T>& rhs)
1705 {
1706 return equal(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
1707 }
1708 template <typename T>
1709 constexpr bool operator!=(const basic_string_view<T>& lhs, const basic_string_view<T>& rhs)
1710 {
1711 return !(lhs == rhs);
1712 }
1713 template <typename T>
1714 std::basic_ostream<T>& operator<<(std::basic_ostream<T>& o, const basic_string_view<T>& s)
1715 {
1716 o << s.data();
1717 return o;
1718 }
1719 template <typename T, std::size_t N>
1720 constexpr basic_string_view<T> make_string_view(const T (&str)[N])
1721 {
1722 return {str, N - 1};
1723 }
1724 template <typename T>
1725 constexpr basic_string_view<T> make_string_view(const T* str, std::size_t s)
1726 {
1727 return {str, s};
1728 }
1733 namespace literals
1734 {
1735 constexpr string_view operator"" _sv(const char* str, std::size_t s)
1736 {
1737 return {str, s};
1738 }
1739 constexpr u16string_view operator"" _sv(const char16_t* str, std::size_t s)
1740 {
1741 return {str, s};
1742 }
1743 constexpr u32string_view operator"" _sv(const char32_t* str, std::size_t s)
1744 {
1745 return {str, s};
1746 }
1747 constexpr wstring_view operator"" _sv(const wchar_t* str, std::size_t s)
1748 {
1749 return {str, s};
1750 }
1751 }
1752 }
1753 #endif
1754 namespace wildcards
1755 {
1756 template <typename Pattern, typename EqualTo = cx::equal_to<void>>
1757 class matcher
1758 {
1759 public:
1760 constexpr explicit matcher(Pattern&& pattern, const cards<container_item_t<Pattern>>& c =
1762 const EqualTo& equal_to = EqualTo())
1763 : p_{cx::cbegin(pattern)},
1764 pend_{cx::cend(std::forward<Pattern>(pattern))},
1765 c_{c},
1766 equal_to_{equal_to}
1767 {
1768 }
1769 constexpr matcher(Pattern&& pattern, const EqualTo& equal_to)
1770 : p_{cx::cbegin(pattern)},
1771 pend_{cx::cend(std::forward<Pattern>(pattern))},
1772 c_{cards<container_item_t<Pattern>>()},
1773 equal_to_{equal_to}
1774 {
1775 }
1776 template <typename Sequence>
1778 Sequence&& sequence) const
1779 {
1781 cx::cbegin(sequence), cx::cend(sequence), p_, pend_,
1782 detail::match(cx::cbegin(sequence), cx::cend(std::forward<Sequence>(sequence)), p_, pend_,
1783 c_, equal_to_));
1784 }
1785 private:
1789 EqualTo equal_to_;
1790 };
1791 template <typename Pattern, typename EqualTo = cx::equal_to<void>>
1793 Pattern&& pattern,
1795 const EqualTo& equal_to = EqualTo())
1796 {
1797 return matcher<Pattern, EqualTo>{std::forward<Pattern>(pattern), c, equal_to};
1798 }
1799 template <typename Pattern, typename EqualTo = cx::equal_to<void>,
1800 typename = typename std::enable_if<!std::is_same<EqualTo, cards_type>::value>::type>
1801 constexpr matcher<Pattern, EqualTo> make_matcher(Pattern&& pattern, const EqualTo& equal_to)
1802 {
1803 return make_matcher(std::forward<Pattern>(pattern), cards<container_item_t<Pattern>>(), equal_to);
1804 }
1805 namespace literals
1806 {
1807 constexpr auto operator"" _wc(const char* str, std::size_t s)
1808 -> decltype(make_matcher(cx::make_string_view(str, s + 1)))
1809 {
1810 return make_matcher(cx::make_string_view(str, s + 1));
1811 }
1812 constexpr auto operator"" _wc(const char16_t* str, std::size_t s)
1813 -> decltype(make_matcher(cx::make_string_view(str, s + 1)))
1814 {
1815 return make_matcher(cx::make_string_view(str, s + 1));
1816 }
1817 constexpr auto operator"" _wc(const char32_t* str, std::size_t s)
1818 -> decltype(make_matcher(cx::make_string_view(str, s + 1)))
1819 {
1820 return make_matcher(cx::make_string_view(str, s + 1));
1821 }
1822 constexpr auto operator"" _wc(const wchar_t* str, std::size_t s)
1823 -> decltype(make_matcher(cx::make_string_view(str, s + 1)))
1824 {
1825 return make_matcher(cx::make_string_view(str, s + 1));
1826 }
1827 }
1828 }
1829 #endif
1830 #endif
wildcards::detail::match_set_state::next_in
@ next_in
cx::less
Definition: wildcards.hpp:582
cx::size
constexpr auto size(const C &c) -> decltype(c.size())
Definition: wildcards.hpp:636
wildcards::container_item_t
typename container_item< C >::type container_item_t
Definition: wildcards.hpp:749
wildcards::full_match_result::pend
PatternIterator pend
Definition: wildcards.hpp:759
wildcards::full_match_result
Definition: wildcards.hpp:755
wildcards::cards< wchar_t >::cards
constexpr cards(wchar_t a, wchar_t s, wchar_t e)
Definition: wildcards.hpp:191
wildcards::cards< char32_t >::cards
constexpr cards(char32_t a, char32_t s, char32_t e, char32_t so, char32_t sc, char32_t sn, char32_t ao, char32_t ac, char32_t ar)
Definition: wildcards.hpp:157
cx::basic_string_view::basic_string_view
constexpr basic_string_view()=default
wildcards::detail::make_full_match_result
constexpr full_match_result< SequenceIterator, PatternIterator > make_full_match_result(SequenceIterator s, SequenceIterator send, PatternIterator p, PatternIterator pend, match_result< SequenceIterator, PatternIterator > mr)
Definition: wildcards.hpp:786
wildcards::iterated_item::type
typename std::remove_cv< typename std::remove_reference< decltype(*std::declval< It >())>::type >::type type
Definition: wildcards.hpp:738
wildcards::container_item
Definition: wildcards.hpp:743
cx::basic_string_view::basic_string_view
constexpr basic_string_view(const T(&str)[N])
Definition: wildcards.hpp:1665
wildcards::detail::set_end_state::open
@ open
wildcards::cards::set_not
T set_not
Definition: wildcards.hpp:48
wildcards::detail::is_set_state::open
@ open
wildcards::iterator::type
typename std::remove_cv< typename std::remove_reference< decltype(cx::begin(std::declval< C >()))>::type >::type type
Definition: wildcards.hpp:730
cx
Definition: wildcards.hpp:579
wildcards::detail::throw_logic_error
constexpr bool throw_logic_error(const char *what_arg)
Definition: wildcards.hpp:803
wildcards::detail::alt_sub_end
constexpr PatternIterator alt_sub_end(PatternIterator p, PatternIterator pend, const cards< iterated_item_t< PatternIterator >> &c=cards< iterated_item_t< PatternIterator >>(), alt_sub_end_state state=alt_sub_end_state::next, int depth=1)
Definition: wildcards.hpp:1348
wildcards::detail::set_end_state::first
@ first
wildcards::cards< char16_t >::cards
constexpr cards(char16_t a, char16_t s, char16_t e, char16_t so, char16_t sc, char16_t sn, char16_t ao, char16_t ac, char16_t ar)
Definition: wildcards.hpp:115
cx::basic_string_view::size
constexpr std::size_t size() const
Definition: wildcards.hpp:1675
wildcards::matcher::equal_to_
EqualTo equal_to_
Definition: wildcards.hpp:1789
wildcards::cards::alt_enabled
bool alt_enabled
Definition: wildcards.hpp:49
wildcards::matcher::matcher
constexpr matcher(Pattern &&pattern, const EqualTo &equal_to)
Definition: wildcards.hpp:1769
wildcards::iterated_item
Definition: wildcards.hpp:735
literals
Definition: json.hpp:24461
wildcards::detail::is_set
constexpr bool is_set(PatternIterator p, PatternIterator pend, const cards< iterated_item_t< PatternIterator >> &c=cards< iterated_item_t< PatternIterator >>(), is_set_state state=is_set_state::open)
Definition: wildcards.hpp:821
cx::cbegin
constexpr auto cbegin(const C &c) -> decltype(cx::begin(c))
Definition: wildcards.hpp:681
wildcards::detail::alt_end_state::open
@ open
cx::empty
constexpr auto empty(const C &c) -> decltype(c.empty())
Definition: wildcards.hpp:646
detail
detail namespace with internal helper functions
Definition: json.hpp:248
wildcards::cards::alt_close
T alt_close
Definition: wildcards.hpp:51
wildcards::detail::match_alt
constexpr match_result< SequenceIterator, PatternIterator > match_alt(SequenceIterator s, SequenceIterator send, PatternIterator p1, PatternIterator p1end, PatternIterator p2, PatternIterator p2end, const cards< iterated_item_t< PatternIterator >> &c=cards< iterated_item_t< PatternIterator >>(), const EqualTo &equal_to=EqualTo(), bool partial=false)
Definition: wildcards.hpp:1456
wildcards::iterator
Definition: wildcards.hpp:727
wildcards::container_item::type
typename std::remove_cv< typename std::remove_reference< decltype(*cx::begin(std::declval< C >()))>::type >::type type
Definition: wildcards.hpp:746
wildcards::detail::match_result::s
SequenceIterator s
Definition: wildcards.hpp:771
cx::operator==
constexpr bool operator==(const basic_string_view< T > &lhs, const basic_string_view< T > &rhs)
Definition: wildcards.hpp:1704
cx::equal_to
Definition: wildcards.hpp:600
wildcards::matcher::p_
const_iterator_t< Pattern > p_
Definition: wildcards.hpp:1786
cx::equal_to::operator()
constexpr auto operator()(const T &lhs, const T &rhs) const -> decltype(lhs==rhs)
Definition: wildcards.hpp:602
wildcards::match
constexpr full_match_result< const_iterator_t< Sequence >, const_iterator_t< Pattern > > match(Sequence &&sequence, Pattern &&pattern, const cards< container_item_t< Pattern >> &c=cards< container_item_t< Pattern >>(), const EqualTo &equal_to=EqualTo())
Definition: wildcards.hpp:1606
cx::equal_to< void >
Definition: wildcards.hpp:608
wildcards::const_iterator
Definition: wildcards.hpp:719
cx::end
constexpr auto end(const C &c) -> decltype(c.end())
Definition: wildcards.hpp:686
detail::void
j template void())
Definition: json.hpp:4893
wildcards::cards< wchar_t >::cards
constexpr cards(cards_type type=cards_type::extended)
Definition: wildcards.hpp:187
wildcards::detail::alt_end
constexpr PatternIterator alt_end(PatternIterator p, PatternIterator pend, const cards< iterated_item_t< PatternIterator >> &c=cards< iterated_item_t< PatternIterator >>(), alt_end_state state=alt_end_state::open, int depth=0)
Definition: wildcards.hpp:1235
wildcards::detail::set_end
constexpr PatternIterator set_end(PatternIterator p, PatternIterator pend, const cards< iterated_item_t< PatternIterator >> &c=cards< iterated_item_t< PatternIterator >>(), set_end_state state=set_end_state::open)
Definition: wildcards.hpp:898
wildcards::detail::set_end_state::not_or_first
@ not_or_first
wildcards::detail::alt_sub_end_state::escape
@ escape
wildcards::full_match_result::p1
PatternIterator p1
Definition: wildcards.hpp:759
wildcards::cards_type
cards_type
Definition: wildcards.hpp:54
wildcards::detail::match
constexpr match_result< SequenceIterator, PatternIterator > match(SequenceIterator s, SequenceIterator send, PatternIterator p, PatternIterator pend, const cards< iterated_item_t< PatternIterator >> &c=cards< iterated_item_t< PatternIterator >>(), const EqualTo &equal_to=EqualTo(), bool partial=false, bool escape=false)
Definition: wildcards.hpp:1491
wildcards::cards::set_close
T set_close
Definition: wildcards.hpp:47
wildcards::cards
Definition: wildcards.hpp:18
wildcards::matcher::matches
constexpr full_match_result< const_iterator_t< Sequence >, const_iterator_t< Pattern > > matches(Sequence &&sequence) const
Definition: wildcards.hpp:1777
wildcards::cards< char32_t >::cards
constexpr cards(char32_t a, char32_t s, char32_t e)
Definition: wildcards.hpp:149
wildcards::detail::alt_sub_end_state
alt_sub_end_state
Definition: wildcards.hpp:1342
cx::basic_string_view::end
constexpr const T * end() const
Definition: wildcards.hpp:1691
wildcards::detail::match_set_state::not_or_first_in
@ not_or_first_in
cx::cend
constexpr auto cend(const C &c) -> decltype(cx::end(c))
Definition: wildcards.hpp:706
wildcards::cards< char16_t >::cards
constexpr cards(cards_type type=cards_type::extended)
Definition: wildcards.hpp:103
cx::basic_string_view::data_
const T * data_
Definition: wildcards.hpp:1700
wildcards::cards::set_enabled
bool set_enabled
Definition: wildcards.hpp:45
wildcards::detail::throw_invalid_argument
constexpr bool throw_invalid_argument(const char *what_arg)
Definition: wildcards.hpp:794
cx::next
constexpr It next(It it)
Definition: wildcards.hpp:626
wildcards::detail::alt_end_state
alt_end_state
Definition: wildcards.hpp:1228
wildcards::cards< char16_t >::cards
constexpr cards(char16_t a, char16_t s, char16_t e)
Definition: wildcards.hpp:107
wildcards::detail::is_alt_state::next
@ next
wildcards::iterated_item_t
typename iterated_item< It >::type iterated_item_t
Definition: wildcards.hpp:741
wildcards::cards_type::standard
@ standard
cx::basic_string_view::begin
constexpr const T * begin() const
Definition: wildcards.hpp:1683
wildcards::detail::match_set
constexpr match_result< SequenceIterator, PatternIterator > match_set(SequenceIterator s, SequenceIterator send, PatternIterator p, PatternIterator pend, const cards< iterated_item_t< PatternIterator >> &c=cards< iterated_item_t< PatternIterator >>(), const EqualTo &equal_to=EqualTo(), match_set_state state=match_set_state::open)
Definition: wildcards.hpp:997
wildcards::detail::match_result
Definition: wildcards.hpp:768
wildcards::matcher::matcher
constexpr matcher(Pattern &&pattern, const cards< container_item_t< Pattern >> &c=cards< container_item_t< Pattern >>(), const EqualTo &equal_to=EqualTo())
Definition: wildcards.hpp:1760
wildcards::detail::match_result::p
PatternIterator p
Definition: wildcards.hpp:772
wildcards::cards< wchar_t >::cards
constexpr cards(wchar_t a, wchar_t s, wchar_t e, wchar_t so, wchar_t sc, wchar_t sn, wchar_t ao, wchar_t ac, wchar_t ar)
Definition: wildcards.hpp:199
cx::basic_string_view::cend
constexpr const T * cend() const
Definition: wildcards.hpp:1695
cx::prev
constexpr It prev(It it)
Definition: wildcards.hpp:631
cx::less< void >::operator()
constexpr auto operator()(T &&lhs, U &&rhs) const -> decltype(std::forward< T >(lhs)< std::forward< U >(rhs))
Definition: wildcards.hpp:593
wildcards::cards::alt_or
T alt_or
Definition: wildcards.hpp:52
wildcards::full_match_result::s
SequenceIterator s
Definition: wildcards.hpp:758
wildcards::cards_type::extended
@ extended
wildcards::full_match_result::p
PatternIterator p
Definition: wildcards.hpp:759
wildcards::cards< char >::cards
constexpr cards(char a, char s, char e)
Definition: wildcards.hpp:66
wildcards::detail::match_set_state
match_set_state
Definition: wildcards.hpp:987
cx::equal
constexpr bool equal(Iterator1 first1, Iterator1 last1, Iterator2 first2, Iterator2 last2)
Definition: wildcards.hpp:1640
cx::basic_string_view::size_
std::size_t size_
Definition: wildcards.hpp:1701
cx::operator<<
std::basic_ostream< T > & operator<<(std::basic_ostream< T > &o, const basic_string_view< T > &s)
Definition: wildcards.hpp:1714
wildcards::detail::alt_end_state::next
@ next
cx::begin
constexpr auto begin(const C &c) -> decltype(c.begin())
Definition: wildcards.hpp:661
cx::basic_string_view::empty
constexpr bool empty() const
Definition: wildcards.hpp:1679
wildcards::detail::alt_sub_end_state::next
@ next
wildcards::const_iterator_t
typename const_iterator< C >::type const_iterator_t
Definition: wildcards.hpp:725
wildcards::detail::make_match_result
constexpr match_result< SequenceIterator, PatternIterator > make_match_result(bool res, SequenceIterator s, PatternIterator p)
Definition: wildcards.hpp:779
wildcards::cards::escape
T escape
Definition: wildcards.hpp:44
wildcards::matcher::c_
cards< container_item_t< Pattern > > c_
Definition: wildcards.hpp:1788
wildcards::full_match_result::send
SequenceIterator send
Definition: wildcards.hpp:758
wildcards::full_match_result::s1
SequenceIterator s1
Definition: wildcards.hpp:758
wildcards::detail::is_set_state::first
@ first
wildcards::detail::is_set_state::not_or_first
@ not_or_first
wildcards::detail::match_result::res
bool res
Definition: wildcards.hpp:770
wildcards::make_matcher
constexpr matcher< Pattern, EqualTo > make_matcher(Pattern &&pattern, const cards< container_item_t< Pattern >> &c=cards< container_item_t< Pattern >>(), const EqualTo &equal_to=EqualTo())
Definition: wildcards.hpp:1792
wildcards::detail::match_set_state::open
@ open
wildcards::detail::match_set_state::first_out
@ first_out
cx::basic_string_view::value_type
T value_type
Definition: wildcards.hpp:1662
wildcards::cards::set_open
T set_open
Definition: wildcards.hpp:46
wildcards::matcher
Definition: wildcards.hpp:1757
wildcards::full_match_result::res
bool res
Definition: wildcards.hpp:757
wildcards::detail::is_alt_state
is_alt_state
Definition: wildcards.hpp:1139
wildcards::const_iterator::type
typename std::remove_cv< typename std::remove_reference< decltype(cx::cbegin(std::declval< C >()))>::type >::type type
Definition: wildcards.hpp:722
wildcards::detail::set_end_state
set_end_state
Definition: wildcards.hpp:890
wildcards::cards::cards
constexpr cards(T a, T s, T e, T so, T sc, T sn, T ao, T ac, T ar)
Definition: wildcards.hpp:28
cx::basic_string_view::basic_string_view
constexpr basic_string_view(const T *str, std::size_t s)
Definition: wildcards.hpp:1668
cx::less::operator()
constexpr auto operator()(const T &lhs, const T &rhs) const -> decltype(lhs< rhs)
Definition: wildcards.hpp:584
cx::basic_string_view::data
constexpr const T * data() const
Definition: wildcards.hpp:1671
wildcards::cards< char32_t >::cards
constexpr cards(cards_type type=cards_type::extended)
Definition: wildcards.hpp:145
wildcards::make_cards
constexpr cards< T > make_cards(T &&a, T &&s, T &&e)
Definition: wildcards.hpp:227
wildcards::cards< char >::cards
constexpr cards(cards_type type=cards_type::extended)
Definition: wildcards.hpp:62
wildcards::detail::is_alt
constexpr bool is_alt(PatternIterator p, PatternIterator pend, const cards< iterated_item_t< PatternIterator >> &c=cards< iterated_item_t< PatternIterator >>(), is_alt_state state=is_alt_state::open, int depth=0)
Definition: wildcards.hpp:1146
wildcards::detail::is_set_state::next
@ next
wildcards::detail::alt_end_state::escape
@ escape
wildcards::cards::single
T single
Definition: wildcards.hpp:43
wildcards::cards::anything
T anything
Definition: wildcards.hpp:42
wildcards::iterator_t
typename iterator< C >::type iterator_t
Definition: wildcards.hpp:733
cx::basic_string_view
Definition: wildcards.hpp:1659
wildcards::matcher::pend_
const_iterator_t< Pattern > pend_
Definition: wildcards.hpp:1787
wildcards::detail::is_set_state
is_set_state
Definition: wildcards.hpp:813
wildcards::detail::is_alt_state::escape
@ escape
wildcards::cards::alt_open
T alt_open
Definition: wildcards.hpp:50
wildcards::detail::match_set_state::next_out
@ next_out
wildcards::detail::is_alt_state::open
@ open
cx::operator!=
constexpr bool operator!=(const basic_string_view< T > &lhs, const basic_string_view< T > &rhs)
Definition: wildcards.hpp:1709
lexyd::p
constexpr auto p
Parses the production.
Definition: production.hpp:127
wildcards::detail::set_end_state::next
@ next
cx::make_string_view
constexpr basic_string_view< T > make_string_view(const T(&str)[N])
Definition: wildcards.hpp:1720
wildcards
Definition: wildcards.hpp:15
cx::equal_to< void >::operator()
constexpr auto operator()(T &&lhs, U &&rhs) const -> decltype(std::forward< T >(lhs)==std::forward< U >(rhs))
Definition: wildcards.hpp:611
cx::basic_string_view::cbegin
constexpr const T * cbegin() const
Definition: wildcards.hpp:1687
wildcards::cards::cards
constexpr cards(T a, T s, T e)
Definition: wildcards.hpp:20
wildcards::cards< char >::cards
constexpr cards(char a, char s, char e, char so, char sc, char sn, char ao, char ac, char ar)
Definition: wildcards.hpp:74


behaviortree_cpp_v4
Author(s): Davide Faconti
autogenerated on Fri Jun 28 2024 02:20:08