1 /*
2 *
3 * Copyright (c) 2004
4 * John Maddock
5 *
6 * Use, modification and distribution are subject to the
7 * Boost Software License, Version 1.0. (See accompanying file
8 * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 *
10 */
11
12 /*
13 * LOCATION: see http://www.boost.org for most recent version.
14 * FILE concepts.hpp
15 * VERSION see <boost/version.hpp>
16 * DESCRIPTION: Declares regular expression concepts.
17 */
18
19 #ifndef BOOST_REGEX_CONCEPTS_HPP_INCLUDED
20 #define BOOST_REGEX_CONCEPTS_HPP_INCLUDED
21
22 #include <boost/concept_archetype.hpp>
23 #include <boost/concept_check.hpp>
24 #include <boost/type_traits/is_enum.hpp>
25 #include <boost/type_traits/is_base_and_derived.hpp>
26 #include <boost/static_assert.hpp>
27 #ifndef BOOST_TEST_TR1_REGEX
28 #include <boost/regex.hpp>
29 #endif
30 #include <bitset>
31 #include <vector>
32 #include <iostream>
33
34 namespace boost{
35
36 //
37 // bitmask_archetype:
38 // this can be either an integer type, an enum, or a std::bitset,
39 // we use the latter as the architype as it offers the "strictest"
40 // of the possible interfaces:
41 //
42 typedef std::bitset<512> bitmask_archetype;
43 //
44 // char_architype:
45 // A strict model for the character type interface.
46 //
47 struct char_architype
48 {
49 // default constructable:
50 char_architype();
51 // copy constructable / assignable:
52 char_architype(const char_architype&);
53 char_architype& operator=(const char_architype&);
54 // constructable from an integral value:
55 char_architype(unsigned long val);
56 // comparable:
57 bool operator==(const char_architype&)const;
58 bool operator!=(const char_architype&)const;
59 bool operator<(const char_architype&)const;
60 bool operator<=(const char_architype&)const;
61 bool operator>=(const char_architype&)const;
62 bool operator>(const char_architype&)const;
63 // conversion to integral type:
64 operator long()const;
65 };
hash_value(char_architype val)66 inline long hash_value(char_architype val)
67 { return val; }
68 //
69 // char_architype can not be used with basic_string:
70 //
71 } // namespace boost
72 namespace std{
73 template<> struct char_traits<boost::char_architype>
74 {
75 // The intent is that this template is not instantiated,
76 // but this typedef gives us a chance of compilation in
77 // case it is:
78 typedef boost::char_architype char_type;
79 };
80 }
81 //
82 // Allocator architype:
83 //
84 template <class T>
85 class allocator_architype
86 {
87 public:
88 typedef T* pointer;
89 typedef const T* const_pointer;
90 typedef T& reference;
91 typedef const T& const_reference;
92 typedef T value_type;
93 typedef unsigned size_type;
94 typedef int difference_type;
95
96 template <class U>
97 struct rebind
98 {
99 typedef allocator_architype<U> other;
100 };
101
address(reference r)102 pointer address(reference r){ return &r; }
address(const_reference r)103 const_pointer address(const_reference r) { return &r; }
allocate(size_type n)104 pointer allocate(size_type n) { return static_cast<pointer>(std::malloc(n)); }
allocate(size_type n,pointer)105 pointer allocate(size_type n, pointer) { return static_cast<pointer>(std::malloc(n)); }
deallocate(pointer p,size_type)106 void deallocate(pointer p, size_type) { std::free(p); }
max_size() const107 size_type max_size()const { return UINT_MAX; }
108
allocator_architype()109 allocator_architype(){}
allocator_architype(const allocator_architype &)110 allocator_architype(const allocator_architype&){}
111
112 template <class Other>
allocator_architype(const allocator_architype<Other> &)113 allocator_architype(const allocator_architype<Other>&){}
114
construct(pointer p,const_reference r)115 void construct(pointer p, const_reference r) { new (p)T(r); }
destroy(pointer p)116 void destroy(pointer p) { p->~T(); }
117 };
118
119 template <class T>
operator ==(const allocator_architype<T> &,const allocator_architype<T> &)120 bool operator == (const allocator_architype<T>&, const allocator_architype<T>&) {return true; }
121 template <class T>
operator !=(const allocator_architype<T> &,const allocator_architype<T> &)122 bool operator != (const allocator_architype<T>&, const allocator_architype<T>&) { return false; }
123
124 namespace boost{
125 //
126 // regex_traits_architype:
127 // A strict interpretation of the regular expression traits class requirements.
128 //
129 template <class charT>
130 struct regex_traits_architype
131 {
132 public:
regex_traits_architypeboost::regex_traits_architype133 regex_traits_architype(){}
134 typedef charT char_type;
135 // typedef std::size_t size_type;
136 typedef std::vector<char_type> string_type;
137 typedef copy_constructible_archetype<assignable_archetype<> > locale_type;
138 typedef bitmask_archetype char_class_type;
139
lengthboost::regex_traits_architype140 static std::size_t length(const char_type* ) { return 0; }
141
translateboost::regex_traits_architype142 charT translate(charT ) const { return charT(); }
translate_nocaseboost::regex_traits_architype143 charT translate_nocase(charT ) const { return static_object<charT>::get(); }
144
145 template <class ForwardIterator>
transformboost::regex_traits_architype146 string_type transform(ForwardIterator , ForwardIterator ) const
147 { return static_object<string_type>::get(); }
148 template <class ForwardIterator>
transform_primaryboost::regex_traits_architype149 string_type transform_primary(ForwardIterator , ForwardIterator ) const
150 { return static_object<string_type>::get(); }
151
152 template <class ForwardIterator>
lookup_classnameboost::regex_traits_architype153 char_class_type lookup_classname(ForwardIterator , ForwardIterator ) const
154 { return static_object<char_class_type>::get(); }
155 template <class ForwardIterator>
lookup_collatenameboost::regex_traits_architype156 string_type lookup_collatename(ForwardIterator , ForwardIterator ) const
157 { return static_object<string_type>::get(); }
158
isctypeboost::regex_traits_architype159 bool isctype(charT, char_class_type) const
160 { return false; }
valueboost::regex_traits_architype161 int value(charT, int) const
162 { return 0; }
163
imbueboost::regex_traits_architype164 locale_type imbue(locale_type l)
165 { return l; }
getlocboost::regex_traits_architype166 locale_type getloc()const
167 { return static_object<locale_type>::get(); }
168
169 private:
170 // this type is not copyable:
regex_traits_architypeboost::regex_traits_architype171 regex_traits_architype(const regex_traits_architype&){}
operator =boost::regex_traits_architype172 regex_traits_architype& operator=(const regex_traits_architype&){ return *this; }
173 };
174
175 //
176 // alter this to std::tr1, to test a std implementation:
177 //
178 #ifndef BOOST_TEST_TR1_REGEX
179 namespace global_regex_namespace = ::boost;
180 #else
181 namespace global_regex_namespace = ::std::tr1;
182 #endif
183
184 template <class Bitmask>
185 struct BitmaskConcept
186 {
constraintsboost::BitmaskConcept187 void constraints()
188 {
189 function_requires<CopyConstructibleConcept<Bitmask> >();
190 function_requires<AssignableConcept<Bitmask> >();
191
192 m_mask1 = m_mask2 | m_mask3;
193 m_mask1 = m_mask2 & m_mask3;
194 m_mask1 = m_mask2 ^ m_mask3;
195
196 m_mask1 = ~m_mask2;
197
198 m_mask1 |= m_mask2;
199 m_mask1 &= m_mask2;
200 m_mask1 ^= m_mask2;
201 }
202 Bitmask m_mask1, m_mask2, m_mask3;
203 };
204
205 template <class traits>
206 struct RegexTraitsConcept
207 {
208 RegexTraitsConcept();
209 // required typedefs:
210 typedef typename traits::char_type char_type;
211 // typedef typename traits::size_type size_type;
212 typedef typename traits::string_type string_type;
213 typedef typename traits::locale_type locale_type;
214 typedef typename traits::char_class_type char_class_type;
215
constraintsboost::RegexTraitsConcept216 void constraints()
217 {
218 //function_requires<UnsignedIntegerConcept<size_type> >();
219 function_requires<RandomAccessContainerConcept<string_type> >();
220 function_requires<DefaultConstructibleConcept<locale_type> >();
221 function_requires<CopyConstructibleConcept<locale_type> >();
222 function_requires<AssignableConcept<locale_type> >();
223 function_requires<BitmaskConcept<char_class_type> >();
224
225 std::size_t n = traits::length(m_pointer);
226 ignore_unused_variable_warning(n);
227
228 char_type c = m_ctraits.translate(m_char);
229 ignore_unused_variable_warning(c);
230 c = m_ctraits.translate_nocase(m_char);
231
232 //string_type::foobar bar;
233 string_type s1 = m_ctraits.transform(m_pointer, m_pointer);
234 ignore_unused_variable_warning(s1);
235
236 string_type s2 = m_ctraits.transform_primary(m_pointer, m_pointer);
237 ignore_unused_variable_warning(s2);
238
239 char_class_type cc = m_ctraits.lookup_classname(m_pointer, m_pointer);
240 ignore_unused_variable_warning(cc);
241
242 string_type s3 = m_ctraits.lookup_collatename(m_pointer, m_pointer);
243 ignore_unused_variable_warning(s3);
244
245 bool b = m_ctraits.isctype(m_char, cc);
246 ignore_unused_variable_warning(b);
247
248 int v = m_ctraits.value(m_char, 16);
249 ignore_unused_variable_warning(v);
250
251 locale_type l(m_ctraits.getloc());
252 m_traits.imbue(l);
253 ignore_unused_variable_warning(l);
254 }
255 traits m_traits;
256 const traits m_ctraits;
257 const char_type* m_pointer;
258 char_type m_char;
259 private:
260 RegexTraitsConcept& operator=(RegexTraitsConcept&);
261 };
262
263 //
264 // helper class to compute what traits class a regular expression type is using:
265 //
266 template <class Regex>
267 struct regex_traits_computer;
268
269 template <class charT, class traits>
270 struct regex_traits_computer< global_regex_namespace::basic_regex<charT, traits> >
271 {
272 typedef traits type;
273 };
274
275 //
276 // BaseRegexConcept does not test anything dependent on basic_string,
277 // in case our charT does not have an associated char_traits:
278 //
279 template <class Regex>
280 struct BaseRegexConcept
281 {
282 typedef typename Regex::value_type value_type;
283 //typedef typename Regex::size_type size_type;
284 typedef typename Regex::flag_type flag_type;
285 typedef typename Regex::locale_type locale_type;
286 typedef input_iterator_archetype<value_type> input_iterator_type;
287
288 // derived test types:
289 typedef const value_type* pointer_type;
290 typedef bidirectional_iterator_archetype<value_type> BidiIterator;
291 typedef global_regex_namespace::sub_match<BidiIterator> sub_match_type;
292 typedef global_regex_namespace::match_results<BidiIterator, allocator_architype<sub_match_type> > match_results_type;
293 typedef global_regex_namespace::match_results<BidiIterator> match_results_default_type;
294 typedef output_iterator_archetype<value_type> OutIterator;
295 typedef typename regex_traits_computer<Regex>::type traits_type;
296 typedef global_regex_namespace::regex_iterator<BidiIterator, value_type, traits_type> regex_iterator_type;
297 typedef global_regex_namespace::regex_token_iterator<BidiIterator, value_type, traits_type> regex_token_iterator_type;
298
global_constraintsboost::BaseRegexConcept299 void global_constraints()
300 {
301 //
302 // test non-template components:
303 //
304 function_requires<BitmaskConcept<global_regex_namespace::regex_constants::syntax_option_type> >();
305 global_regex_namespace::regex_constants::syntax_option_type opts
306 = global_regex_namespace::regex_constants::icase
307 | global_regex_namespace::regex_constants::nosubs
308 | global_regex_namespace::regex_constants::optimize
309 | global_regex_namespace::regex_constants::collate
310 | global_regex_namespace::regex_constants::ECMAScript
311 | global_regex_namespace::regex_constants::basic
312 | global_regex_namespace::regex_constants::extended
313 | global_regex_namespace::regex_constants::awk
314 | global_regex_namespace::regex_constants::grep
315 | global_regex_namespace::regex_constants::egrep;
316 ignore_unused_variable_warning(opts);
317
318 function_requires<BitmaskConcept<global_regex_namespace::regex_constants::match_flag_type> >();
319 global_regex_namespace::regex_constants::match_flag_type mopts
320 = global_regex_namespace::regex_constants::match_default
321 | global_regex_namespace::regex_constants::match_not_bol
322 | global_regex_namespace::regex_constants::match_not_eol
323 | global_regex_namespace::regex_constants::match_not_bow
324 | global_regex_namespace::regex_constants::match_not_eow
325 | global_regex_namespace::regex_constants::match_any
326 | global_regex_namespace::regex_constants::match_not_null
327 | global_regex_namespace::regex_constants::match_continuous
328 | global_regex_namespace::regex_constants::match_prev_avail
329 | global_regex_namespace::regex_constants::format_default
330 | global_regex_namespace::regex_constants::format_sed
331 | global_regex_namespace::regex_constants::format_no_copy
332 | global_regex_namespace::regex_constants::format_first_only;
333 ignore_unused_variable_warning(mopts);
334
335 BOOST_STATIC_ASSERT((::boost::is_enum<global_regex_namespace::regex_constants::error_type>::value));
336 global_regex_namespace::regex_constants::error_type e1 = global_regex_namespace::regex_constants::error_collate;
337 ignore_unused_variable_warning(e1);
338 e1 = global_regex_namespace::regex_constants::error_ctype;
339 ignore_unused_variable_warning(e1);
340 e1 = global_regex_namespace::regex_constants::error_escape;
341 ignore_unused_variable_warning(e1);
342 e1 = global_regex_namespace::regex_constants::error_backref;
343 ignore_unused_variable_warning(e1);
344 e1 = global_regex_namespace::regex_constants::error_brack;
345 ignore_unused_variable_warning(e1);
346 e1 = global_regex_namespace::regex_constants::error_paren;
347 ignore_unused_variable_warning(e1);
348 e1 = global_regex_namespace::regex_constants::error_brace;
349 ignore_unused_variable_warning(e1);
350 e1 = global_regex_namespace::regex_constants::error_badbrace;
351 ignore_unused_variable_warning(e1);
352 e1 = global_regex_namespace::regex_constants::error_range;
353 ignore_unused_variable_warning(e1);
354 e1 = global_regex_namespace::regex_constants::error_space;
355 ignore_unused_variable_warning(e1);
356 e1 = global_regex_namespace::regex_constants::error_badrepeat;
357 ignore_unused_variable_warning(e1);
358 e1 = global_regex_namespace::regex_constants::error_complexity;
359 ignore_unused_variable_warning(e1);
360 e1 = global_regex_namespace::regex_constants::error_stack;
361 ignore_unused_variable_warning(e1);
362
363 BOOST_STATIC_ASSERT((::boost::is_base_and_derived<std::runtime_error, global_regex_namespace::regex_error>::value ));
364 const global_regex_namespace::regex_error except(e1);
365 e1 = except.code();
366
367 typedef typename Regex::value_type regex_value_type;
368 function_requires< RegexTraitsConcept<global_regex_namespace::regex_traits<char> > >();
369 function_requires< BaseRegexConcept<global_regex_namespace::basic_regex<char> > >();
370 }
constraintsboost::BaseRegexConcept371 void constraints()
372 {
373 global_constraints();
374
375 BOOST_STATIC_ASSERT((::boost::is_same< flag_type, global_regex_namespace::regex_constants::syntax_option_type>::value));
376 flag_type opts
377 = Regex::icase
378 | Regex::nosubs
379 | Regex::optimize
380 | Regex::collate
381 | Regex::ECMAScript
382 | Regex::basic
383 | Regex::extended
384 | Regex::awk
385 | Regex::grep
386 | Regex::egrep;
387 ignore_unused_variable_warning(opts);
388
389 function_requires<DefaultConstructibleConcept<Regex> >();
390 function_requires<CopyConstructibleConcept<Regex> >();
391
392 // Regex constructors:
393 Regex e1(m_pointer);
394 ignore_unused_variable_warning(e1);
395 Regex e2(m_pointer, m_flags);
396 ignore_unused_variable_warning(e2);
397 Regex e3(m_pointer, m_size, m_flags);
398 ignore_unused_variable_warning(e3);
399 Regex e4(in1, in2);
400 ignore_unused_variable_warning(e4);
401 Regex e5(in1, in2, m_flags);
402 ignore_unused_variable_warning(e5);
403
404 // assign etc:
405 Regex e;
406 e = m_pointer;
407 e = e1;
408 e.assign(e1);
409 e.assign(m_pointer);
410 e.assign(m_pointer, m_flags);
411 e.assign(m_pointer, m_size, m_flags);
412 e.assign(in1, in2);
413 e.assign(in1, in2, m_flags);
414
415 // access:
416 const Regex ce;
417 typename Regex::size_type i = ce.mark_count();
418 ignore_unused_variable_warning(i);
419 m_flags = ce.flags();
420 e.imbue(ce.getloc());
421 e.swap(e1);
422
423 global_regex_namespace::swap(e, e1);
424
425 // sub_match:
426 BOOST_STATIC_ASSERT((::boost::is_base_and_derived<std::pair<BidiIterator, BidiIterator>, sub_match_type>::value));
427 typedef typename sub_match_type::value_type sub_value_type;
428 typedef typename sub_match_type::difference_type sub_diff_type;
429 typedef typename sub_match_type::iterator sub_iter_type;
430 BOOST_STATIC_ASSERT((::boost::is_same<sub_value_type, value_type>::value));
431 BOOST_STATIC_ASSERT((::boost::is_same<sub_iter_type, BidiIterator>::value));
432 bool b = m_sub.matched;
433 ignore_unused_variable_warning(b);
434 BidiIterator bi = m_sub.first;
435 ignore_unused_variable_warning(bi);
436 bi = m_sub.second;
437 ignore_unused_variable_warning(bi);
438 sub_diff_type diff = m_sub.length();
439 ignore_unused_variable_warning(diff);
440 // match_results tests - some typedefs are not used, however these
441 // guarante that they exist (some compilers may warn on non-usage)
442 typedef typename match_results_type::value_type mr_value_type;
443 typedef typename match_results_type::const_reference mr_const_reference;
444 typedef typename match_results_type::reference mr_reference;
445 typedef typename match_results_type::const_iterator mr_const_iterator;
446 typedef typename match_results_type::iterator mr_iterator;
447 typedef typename match_results_type::difference_type mr_difference_type;
448 typedef typename match_results_type::size_type mr_size_type;
449 typedef typename match_results_type::allocator_type mr_allocator_type;
450 typedef typename match_results_type::char_type mr_char_type;
451 typedef typename match_results_type::string_type mr_string_type;
452
453 match_results_type m1;
454 mr_allocator_type at;
455 match_results_type m2(at);
456 match_results_type m3(m1);
457 m1 = m2;
458
459 int ival = 0;
460
461 mr_size_type mrs = m_cresults.size();
462 ignore_unused_variable_warning(mrs);
463 mrs = m_cresults.max_size();
464 ignore_unused_variable_warning(mrs);
465 b = m_cresults.empty();
466 ignore_unused_variable_warning(b);
467 mr_difference_type mrd = m_cresults.length();
468 ignore_unused_variable_warning(mrd);
469 mrd = m_cresults.length(ival);
470 ignore_unused_variable_warning(mrd);
471 mrd = m_cresults.position();
472 ignore_unused_variable_warning(mrd);
473 mrd = m_cresults.position(mrs);
474 ignore_unused_variable_warning(mrd);
475
476 mr_const_reference mrcr = m_cresults[ival];
477 ignore_unused_variable_warning(mrcr);
478 mr_const_reference mrcr2 = m_cresults.prefix();
479 ignore_unused_variable_warning(mrcr2);
480 mr_const_reference mrcr3 = m_cresults.suffix();
481 ignore_unused_variable_warning(mrcr3);
482 mr_const_iterator mrci = m_cresults.begin();
483 ignore_unused_variable_warning(mrci);
484 mrci = m_cresults.end();
485 ignore_unused_variable_warning(mrci);
486
487 (void) m_cresults.get_allocator();
488 m_results.swap(m_results);
489 global_regex_namespace::swap(m_results, m_results);
490
491 // regex_match:
492 b = global_regex_namespace::regex_match(m_in, m_in, m_results, e);
493 ignore_unused_variable_warning(b);
494 b = global_regex_namespace::regex_match(m_in, m_in, m_results, e, m_mft);
495 ignore_unused_variable_warning(b);
496 b = global_regex_namespace::regex_match(m_in, m_in, e);
497 ignore_unused_variable_warning(b);
498 b = global_regex_namespace::regex_match(m_in, m_in, e, m_mft);
499 ignore_unused_variable_warning(b);
500 b = global_regex_namespace::regex_match(m_pointer, m_pmatch, e);
501 ignore_unused_variable_warning(b);
502 b = global_regex_namespace::regex_match(m_pointer, m_pmatch, e, m_mft);
503 ignore_unused_variable_warning(b);
504 b = global_regex_namespace::regex_match(m_pointer, e);
505 ignore_unused_variable_warning(b);
506 b = global_regex_namespace::regex_match(m_pointer, e, m_mft);
507 ignore_unused_variable_warning(b);
508 // regex_search:
509 b = global_regex_namespace::regex_search(m_in, m_in, m_results, e);
510 ignore_unused_variable_warning(b);
511 b = global_regex_namespace::regex_search(m_in, m_in, m_results, e, m_mft);
512 ignore_unused_variable_warning(b);
513 b = global_regex_namespace::regex_search(m_in, m_in, e);
514 ignore_unused_variable_warning(b);
515 b = global_regex_namespace::regex_search(m_in, m_in, e, m_mft);
516 ignore_unused_variable_warning(b);
517 b = global_regex_namespace::regex_search(m_pointer, m_pmatch, e);
518 ignore_unused_variable_warning(b);
519 b = global_regex_namespace::regex_search(m_pointer, m_pmatch, e, m_mft);
520 ignore_unused_variable_warning(b);
521 b = global_regex_namespace::regex_search(m_pointer, e);
522 ignore_unused_variable_warning(b);
523 b = global_regex_namespace::regex_search(m_pointer, e, m_mft);
524 ignore_unused_variable_warning(b);
525
526 // regex_iterator:
527 typedef typename regex_iterator_type::regex_type rit_regex_type;
528 typedef typename regex_iterator_type::value_type rit_value_type;
529 typedef typename regex_iterator_type::difference_type rit_difference_type;
530 typedef typename regex_iterator_type::pointer rit_pointer;
531 typedef typename regex_iterator_type::reference rit_reference;
532 typedef typename regex_iterator_type::iterator_category rit_iterator_category;
533 BOOST_STATIC_ASSERT((::boost::is_same<rit_regex_type, Regex>::value));
534 BOOST_STATIC_ASSERT((::boost::is_same<rit_value_type, match_results_default_type>::value));
535 BOOST_STATIC_ASSERT((::boost::is_same<rit_difference_type, std::ptrdiff_t>::value));
536 BOOST_STATIC_ASSERT((::boost::is_same<rit_pointer, const match_results_default_type*>::value));
537 BOOST_STATIC_ASSERT((::boost::is_same<rit_reference, const match_results_default_type&>::value));
538 BOOST_STATIC_ASSERT((::boost::is_convertible<rit_iterator_category*, std::forward_iterator_tag*>::value));
539 // this takes care of most of the checks needed:
540 function_requires<ForwardIteratorConcept<regex_iterator_type> >();
541 regex_iterator_type iter1(m_in, m_in, e);
542 ignore_unused_variable_warning(iter1);
543 regex_iterator_type iter2(m_in, m_in, e, m_mft);
544 ignore_unused_variable_warning(iter2);
545
546 // regex_token_iterator:
547 typedef typename regex_token_iterator_type::regex_type rtit_regex_type;
548 typedef typename regex_token_iterator_type::value_type rtit_value_type;
549 typedef typename regex_token_iterator_type::difference_type rtit_difference_type;
550 typedef typename regex_token_iterator_type::pointer rtit_pointer;
551 typedef typename regex_token_iterator_type::reference rtit_reference;
552 typedef typename regex_token_iterator_type::iterator_category rtit_iterator_category;
553 BOOST_STATIC_ASSERT((::boost::is_same<rtit_regex_type, Regex>::value));
554 BOOST_STATIC_ASSERT((::boost::is_same<rtit_value_type, sub_match_type>::value));
555 BOOST_STATIC_ASSERT((::boost::is_same<rtit_difference_type, std::ptrdiff_t>::value));
556 BOOST_STATIC_ASSERT((::boost::is_same<rtit_pointer, const sub_match_type*>::value));
557 BOOST_STATIC_ASSERT((::boost::is_same<rtit_reference, const sub_match_type&>::value));
558 BOOST_STATIC_ASSERT((::boost::is_convertible<rtit_iterator_category*, std::forward_iterator_tag*>::value));
559 // this takes care of most of the checks needed:
560 function_requires<ForwardIteratorConcept<regex_token_iterator_type> >();
561 regex_token_iterator_type ti1(m_in, m_in, e);
562 ignore_unused_variable_warning(ti1);
563 regex_token_iterator_type ti2(m_in, m_in, e, 0);
564 ignore_unused_variable_warning(ti2);
565 regex_token_iterator_type ti3(m_in, m_in, e, 0, m_mft);
566 ignore_unused_variable_warning(ti3);
567 std::vector<int> subs;
568 regex_token_iterator_type ti4(m_in, m_in, e, subs);
569 ignore_unused_variable_warning(ti4);
570 regex_token_iterator_type ti5(m_in, m_in, e, subs, m_mft);
571 ignore_unused_variable_warning(ti5);
572 static const int i_array[3] = { 1, 2, 3, };
573 regex_token_iterator_type ti6(m_in, m_in, e, i_array);
574 ignore_unused_variable_warning(ti6);
575 regex_token_iterator_type ti7(m_in, m_in, e, i_array, m_mft);
576 ignore_unused_variable_warning(ti7);
577 }
578
579 pointer_type m_pointer;
580 flag_type m_flags;
581 std::size_t m_size;
582 input_iterator_type in1, in2;
583 const sub_match_type m_sub;
584 const value_type m_char;
585 match_results_type m_results;
586 const match_results_type m_cresults;
587 OutIterator m_out;
588 BidiIterator m_in;
589 global_regex_namespace::regex_constants::match_flag_type m_mft;
590 global_regex_namespace::match_results<
591 pointer_type,
592 allocator_architype<global_regex_namespace::sub_match<pointer_type> > >
593 m_pmatch;
594
595 BaseRegexConcept();
596 BaseRegexConcept(const BaseRegexConcept&);
597 BaseRegexConcept& operator=(const BaseRegexConcept&);
598 };
599
600 //
601 // RegexConcept:
602 // Test every interface in the std:
603 //
604 template <class Regex>
605 struct RegexConcept
606 {
607 typedef typename Regex::value_type value_type;
608 //typedef typename Regex::size_type size_type;
609 typedef typename Regex::flag_type flag_type;
610 typedef typename Regex::locale_type locale_type;
611
612 // derived test types:
613 typedef const value_type* pointer_type;
614 typedef std::basic_string<value_type> string_type;
615 typedef boost::bidirectional_iterator_archetype<value_type> BidiIterator;
616 typedef global_regex_namespace::sub_match<BidiIterator> sub_match_type;
617 typedef global_regex_namespace::match_results<BidiIterator, allocator_architype<sub_match_type> > match_results_type;
618 typedef output_iterator_archetype<value_type> OutIterator;
619
620
constraintsboost::RegexConcept621 void constraints()
622 {
623 function_requires<BaseRegexConcept<Regex> >();
624 // string based construct:
625 Regex e1(m_string);
626 ignore_unused_variable_warning(e1);
627 Regex e2(m_string, m_flags);
628 ignore_unused_variable_warning(e2);
629
630 // assign etc:
631 Regex e;
632 e = m_string;
633 e.assign(m_string);
634 e.assign(m_string, m_flags);
635
636 // sub_match:
637 string_type s(m_sub);
638 ignore_unused_variable_warning(s);
639 s = m_sub.str();
640 ignore_unused_variable_warning(s);
641 int i = m_sub.compare(m_string);
642 ignore_unused_variable_warning(i);
643
644 int i2 = m_sub.compare(m_sub);
645 ignore_unused_variable_warning(i2);
646 i2 = m_sub.compare(m_pointer);
647 ignore_unused_variable_warning(i2);
648
649 bool b = m_sub == m_sub;
650 ignore_unused_variable_warning(b);
651 b = m_sub != m_sub;
652 ignore_unused_variable_warning(b);
653 b = m_sub <= m_sub;
654 ignore_unused_variable_warning(b);
655 b = m_sub <= m_sub;
656 ignore_unused_variable_warning(b);
657 b = m_sub > m_sub;
658 ignore_unused_variable_warning(b);
659 b = m_sub >= m_sub;
660 ignore_unused_variable_warning(b);
661
662 b = m_sub == m_pointer;
663 ignore_unused_variable_warning(b);
664 b = m_sub != m_pointer;
665 ignore_unused_variable_warning(b);
666 b = m_sub <= m_pointer;
667 ignore_unused_variable_warning(b);
668 b = m_sub <= m_pointer;
669 ignore_unused_variable_warning(b);
670 b = m_sub > m_pointer;
671 ignore_unused_variable_warning(b);
672 b = m_sub >= m_pointer;
673 ignore_unused_variable_warning(b);
674
675 b = m_pointer == m_sub;
676 ignore_unused_variable_warning(b);
677 b = m_pointer != m_sub;
678 ignore_unused_variable_warning(b);
679 b = m_pointer <= m_sub;
680 ignore_unused_variable_warning(b);
681 b = m_pointer <= m_sub;
682 ignore_unused_variable_warning(b);
683 b = m_pointer > m_sub;
684 ignore_unused_variable_warning(b);
685 b = m_pointer >= m_sub;
686 ignore_unused_variable_warning(b);
687
688 b = m_sub == m_char;
689 ignore_unused_variable_warning(b);
690 b = m_sub != m_char;
691 ignore_unused_variable_warning(b);
692 b = m_sub <= m_char;
693 ignore_unused_variable_warning(b);
694 b = m_sub <= m_char;
695 ignore_unused_variable_warning(b);
696 b = m_sub > m_char;
697 ignore_unused_variable_warning(b);
698 b = m_sub >= m_char;
699 ignore_unused_variable_warning(b);
700
701 b = m_char == m_sub;
702 ignore_unused_variable_warning(b);
703 b = m_char != m_sub;
704 ignore_unused_variable_warning(b);
705 b = m_char <= m_sub;
706 ignore_unused_variable_warning(b);
707 b = m_char <= m_sub;
708 ignore_unused_variable_warning(b);
709 b = m_char > m_sub;
710 ignore_unused_variable_warning(b);
711 b = m_char >= m_sub;
712 ignore_unused_variable_warning(b);
713
714 b = m_sub == m_string;
715 ignore_unused_variable_warning(b);
716 b = m_sub != m_string;
717 ignore_unused_variable_warning(b);
718 b = m_sub <= m_string;
719 ignore_unused_variable_warning(b);
720 b = m_sub <= m_string;
721 ignore_unused_variable_warning(b);
722 b = m_sub > m_string;
723 ignore_unused_variable_warning(b);
724 b = m_sub >= m_string;
725 ignore_unused_variable_warning(b);
726
727 b = m_string == m_sub;
728 ignore_unused_variable_warning(b);
729 b = m_string != m_sub;
730 ignore_unused_variable_warning(b);
731 b = m_string <= m_sub;
732 ignore_unused_variable_warning(b);
733 b = m_string <= m_sub;
734 ignore_unused_variable_warning(b);
735 b = m_string > m_sub;
736 ignore_unused_variable_warning(b);
737 b = m_string >= m_sub;
738 ignore_unused_variable_warning(b);
739
740 // match results:
741 m_string = m_results.str();
742 ignore_unused_variable_warning(m_string);
743 m_string = m_results.str(0);
744 ignore_unused_variable_warning(m_string);
745 m_out = m_cresults.format(m_out, m_string);
746 m_out = m_cresults.format(m_out, m_string, m_mft);
747 m_string = m_cresults.format(m_string);
748 ignore_unused_variable_warning(m_string);
749 m_string = m_cresults.format(m_string, m_mft);
750 ignore_unused_variable_warning(m_string);
751
752 // regex_match:
753 b = global_regex_namespace::regex_match(m_string, m_smatch, e);
754 ignore_unused_variable_warning(b);
755 b = global_regex_namespace::regex_match(m_string, m_smatch, e, m_mft);
756 ignore_unused_variable_warning(b);
757 b = global_regex_namespace::regex_match(m_string, e);
758 ignore_unused_variable_warning(b);
759 b = global_regex_namespace::regex_match(m_string, e, m_mft);
760 ignore_unused_variable_warning(b);
761
762 // regex_search:
763 b = global_regex_namespace::regex_search(m_string, m_smatch, e);
764 ignore_unused_variable_warning(b);
765 b = global_regex_namespace::regex_search(m_string, m_smatch, e, m_mft);
766 ignore_unused_variable_warning(b);
767 b = global_regex_namespace::regex_search(m_string, e);
768 ignore_unused_variable_warning(b);
769 b = global_regex_namespace::regex_search(m_string, e, m_mft);
770 ignore_unused_variable_warning(b);
771
772 // regex_replace:
773 m_out = global_regex_namespace::regex_replace(m_out, m_in, m_in, e, m_string, m_mft);
774 m_out = global_regex_namespace::regex_replace(m_out, m_in, m_in, e, m_string);
775 m_string = global_regex_namespace::regex_replace(m_string, e, m_string, m_mft);
776 ignore_unused_variable_warning(m_string);
777 m_string = global_regex_namespace::regex_replace(m_string, e, m_string);
778 ignore_unused_variable_warning(m_string);
779
780 }
781
782 flag_type m_flags;
783 string_type m_string;
784 const sub_match_type m_sub;
785 match_results_type m_results;
786 pointer_type m_pointer;
787 value_type m_char;
788 const match_results_type m_cresults;
789 OutIterator m_out;
790 BidiIterator m_in;
791 global_regex_namespace::regex_constants::match_flag_type m_mft;
792 global_regex_namespace::match_results<typename string_type::const_iterator, allocator_architype<global_regex_namespace::sub_match<typename string_type::const_iterator> > > m_smatch;
793
794 RegexConcept();
795 RegexConcept(const RegexConcept&);
796 RegexConcept& operator=(const RegexConcept&);
797 };
798
799 #ifndef BOOST_REGEX_TEST_STD
800
801 template <class M>
802 struct functor1
803 {
804 typedef typename M::char_type char_type;
operator ()boost::functor1805 const char_type* operator()(const M&)const
806 {
807 static const char_type c = static_cast<char_type>(0);
808 return &c;
809 }
810 };
811 template <class M>
812 struct functor1b
813 {
814 typedef typename M::char_type char_type;
operator ()boost::functor1b815 std::vector<char_type> operator()(const M&)const
816 {
817 static const std::vector<char_type> c;
818 return c;
819 }
820 };
821 template <class M>
822 struct functor2
823 {
824 template <class O>
operator ()boost::functor2825 O operator()(const M& /*m*/, O i)const
826 {
827 return i;
828 }
829 };
830 template <class M>
831 struct functor3
832 {
833 template <class O>
operator ()boost::functor3834 O operator()(const M& /*m*/, O i, regex_constants::match_flag_type)const
835 {
836 return i;
837 }
838 };
839
840 //
841 // BoostRegexConcept:
842 // Test every interface in the Boost implementation:
843 //
844 template <class Regex>
845 struct BoostRegexConcept
846 {
847 typedef typename Regex::value_type value_type;
848 typedef typename Regex::size_type size_type;
849 typedef typename Regex::flag_type flag_type;
850 typedef typename Regex::locale_type locale_type;
851
852 // derived test types:
853 typedef const value_type* pointer_type;
854 typedef std::basic_string<value_type> string_type;
855 typedef typename Regex::const_iterator const_iterator;
856 typedef bidirectional_iterator_archetype<value_type> BidiIterator;
857 typedef output_iterator_archetype<value_type> OutputIterator;
858 typedef global_regex_namespace::sub_match<BidiIterator> sub_match_type;
859 typedef global_regex_namespace::match_results<BidiIterator, allocator_architype<sub_match_type> > match_results_type;
860 typedef global_regex_namespace::match_results<BidiIterator> match_results_default_type;
861
constraintsboost::BoostRegexConcept862 void constraints()
863 {
864 global_regex_namespace::regex_constants::match_flag_type mopts
865 = global_regex_namespace::regex_constants::match_default
866 | global_regex_namespace::regex_constants::match_not_bol
867 | global_regex_namespace::regex_constants::match_not_eol
868 | global_regex_namespace::regex_constants::match_not_bow
869 | global_regex_namespace::regex_constants::match_not_eow
870 | global_regex_namespace::regex_constants::match_any
871 | global_regex_namespace::regex_constants::match_not_null
872 | global_regex_namespace::regex_constants::match_continuous
873 | global_regex_namespace::regex_constants::match_partial
874 | global_regex_namespace::regex_constants::match_prev_avail
875 | global_regex_namespace::regex_constants::format_default
876 | global_regex_namespace::regex_constants::format_sed
877 | global_regex_namespace::regex_constants::format_perl
878 | global_regex_namespace::regex_constants::format_no_copy
879 | global_regex_namespace::regex_constants::format_first_only;
880
881 (void)mopts;
882
883 function_requires<RegexConcept<Regex> >();
884 const global_regex_namespace::regex_error except(global_regex_namespace::regex_constants::error_collate);
885 std::ptrdiff_t pt = except.position();
886 ignore_unused_variable_warning(pt);
887 const Regex ce, ce2;
888 #ifndef BOOST_NO_STD_LOCALE
889 m_stream << ce;
890 #endif
891 unsigned i = ce.error_code();
892 ignore_unused_variable_warning(i);
893 pointer_type p = ce.expression();
894 ignore_unused_variable_warning(p);
895 int i2 = ce.compare(ce2);
896 ignore_unused_variable_warning(i2);
897 bool b = ce == ce2;
898 ignore_unused_variable_warning(b);
899 b = ce.empty();
900 ignore_unused_variable_warning(b);
901 b = ce != ce2;
902 ignore_unused_variable_warning(b);
903 b = ce < ce2;
904 ignore_unused_variable_warning(b);
905 b = ce > ce2;
906 ignore_unused_variable_warning(b);
907 b = ce <= ce2;
908 ignore_unused_variable_warning(b);
909 b = ce >= ce2;
910 ignore_unused_variable_warning(b);
911 i = ce.status();
912 ignore_unused_variable_warning(i);
913 size_type s = ce.max_size();
914 ignore_unused_variable_warning(s);
915 s = ce.size();
916 ignore_unused_variable_warning(s);
917 const_iterator pi = ce.begin();
918 ignore_unused_variable_warning(pi);
919 pi = ce.end();
920 ignore_unused_variable_warning(pi);
921 string_type s2 = ce.str();
922 ignore_unused_variable_warning(s2);
923
924 m_string = m_sub + m_sub;
925 ignore_unused_variable_warning(m_string);
926 m_string = m_sub + m_pointer;
927 ignore_unused_variable_warning(m_string);
928 m_string = m_pointer + m_sub;
929 ignore_unused_variable_warning(m_string);
930 m_string = m_sub + m_string;
931 ignore_unused_variable_warning(m_string);
932 m_string = m_string + m_sub;
933 ignore_unused_variable_warning(m_string);
934 m_string = m_sub + m_char;
935 ignore_unused_variable_warning(m_string);
936 m_string = m_char + m_sub;
937 ignore_unused_variable_warning(m_string);
938
939 // Named sub-expressions:
940 m_sub = m_cresults[&m_char];
941 ignore_unused_variable_warning(m_sub);
942 m_sub = m_cresults[m_string];
943 ignore_unused_variable_warning(m_sub);
944 m_sub = m_cresults[""];
945 ignore_unused_variable_warning(m_sub);
946 m_sub = m_cresults[std::string("")];
947 ignore_unused_variable_warning(m_sub);
948 m_string = m_cresults.str(&m_char);
949 ignore_unused_variable_warning(m_string);
950 m_string = m_cresults.str(m_string);
951 ignore_unused_variable_warning(m_string);
952 m_string = m_cresults.str("");
953 ignore_unused_variable_warning(m_string);
954 m_string = m_cresults.str(std::string(""));
955 ignore_unused_variable_warning(m_string);
956
957 typename match_results_type::difference_type diff;
958 diff = m_cresults.length(&m_char);
959 ignore_unused_variable_warning(diff);
960 diff = m_cresults.length(m_string);
961 ignore_unused_variable_warning(diff);
962 diff = m_cresults.length("");
963 ignore_unused_variable_warning(diff);
964 diff = m_cresults.length(std::string(""));
965 ignore_unused_variable_warning(diff);
966 diff = m_cresults.position(&m_char);
967 ignore_unused_variable_warning(diff);
968 diff = m_cresults.position(m_string);
969 ignore_unused_variable_warning(diff);
970 diff = m_cresults.position("");
971 ignore_unused_variable_warning(diff);
972 diff = m_cresults.position(std::string(""));
973 ignore_unused_variable_warning(diff);
974
975 #ifndef BOOST_NO_STD_LOCALE
976 m_stream << m_sub;
977 m_stream << m_cresults;
978 #endif
979 //
980 // Extended formatting with a functor:
981 //
982 regex_constants::match_flag_type f = regex_constants::match_default;
983 OutputIterator out = static_object<OutputIterator>::get();
984
985 functor3<match_results_default_type> func3;
986 functor2<match_results_default_type> func2;
987 functor1<match_results_default_type> func1;
988
989 functor3<match_results_type> func3b;
990 functor2<match_results_type> func2b;
991 functor1<match_results_type> func1b;
992
993 out = regex_format(out, m_cresults, func3b, f);
994 out = regex_format(out, m_cresults, func3b);
995 out = regex_format(out, m_cresults, func2b, f);
996 out = regex_format(out, m_cresults, func2b);
997 out = regex_format(out, m_cresults, func1b, f);
998 out = regex_format(out, m_cresults, func1b);
999 out = regex_format(out, m_cresults, boost::ref(func3b), f);
1000 out = regex_format(out, m_cresults, boost::ref(func3b));
1001 out = regex_format(out, m_cresults, boost::ref(func2b), f);
1002 out = regex_format(out, m_cresults, boost::ref(func2b));
1003 out = regex_format(out, m_cresults, boost::ref(func1b), f);
1004 out = regex_format(out, m_cresults, boost::ref(func1b));
1005 out = regex_format(out, m_cresults, boost::cref(func3b), f);
1006 out = regex_format(out, m_cresults, boost::cref(func3b));
1007 out = regex_format(out, m_cresults, boost::cref(func2b), f);
1008 out = regex_format(out, m_cresults, boost::cref(func2b));
1009 out = regex_format(out, m_cresults, boost::cref(func1b), f);
1010 out = regex_format(out, m_cresults, boost::cref(func1b));
1011
1012 m_string += regex_format(m_cresults, func3b, f);
1013 m_string += regex_format(m_cresults, func3b);
1014 m_string += regex_format(m_cresults, func2b, f);
1015 m_string += regex_format(m_cresults, func2b);
1016 m_string += regex_format(m_cresults, func1b, f);
1017 m_string += regex_format(m_cresults, func1b);
1018 m_string += regex_format(m_cresults, boost::ref(func3b), f);
1019 m_string += regex_format(m_cresults, boost::ref(func3b));
1020 m_string += regex_format(m_cresults, boost::ref(func2b), f);
1021 m_string += regex_format(m_cresults, boost::ref(func2b));
1022 m_string += regex_format(m_cresults, boost::ref(func1b), f);
1023 m_string += regex_format(m_cresults, boost::ref(func1b));
1024 m_string += regex_format(m_cresults, boost::cref(func3b), f);
1025 m_string += regex_format(m_cresults, boost::cref(func3b));
1026 m_string += regex_format(m_cresults, boost::cref(func2b), f);
1027 m_string += regex_format(m_cresults, boost::cref(func2b));
1028 m_string += regex_format(m_cresults, boost::cref(func1b), f);
1029 m_string += regex_format(m_cresults, boost::cref(func1b));
1030
1031 out = m_cresults.format(out, func3b, f);
1032 out = m_cresults.format(out, func3b);
1033 out = m_cresults.format(out, func2b, f);
1034 out = m_cresults.format(out, func2b);
1035 out = m_cresults.format(out, func1b, f);
1036 out = m_cresults.format(out, func1b);
1037 out = m_cresults.format(out, boost::ref(func3b), f);
1038 out = m_cresults.format(out, boost::ref(func3b));
1039 out = m_cresults.format(out, boost::ref(func2b), f);
1040 out = m_cresults.format(out, boost::ref(func2b));
1041 out = m_cresults.format(out, boost::ref(func1b), f);
1042 out = m_cresults.format(out, boost::ref(func1b));
1043 out = m_cresults.format(out, boost::cref(func3b), f);
1044 out = m_cresults.format(out, boost::cref(func3b));
1045 out = m_cresults.format(out, boost::cref(func2b), f);
1046 out = m_cresults.format(out, boost::cref(func2b));
1047 out = m_cresults.format(out, boost::cref(func1b), f);
1048 out = m_cresults.format(out, boost::cref(func1b));
1049
1050 m_string += m_cresults.format(func3b, f);
1051 m_string += m_cresults.format(func3b);
1052 m_string += m_cresults.format(func2b, f);
1053 m_string += m_cresults.format(func2b);
1054 m_string += m_cresults.format(func1b, f);
1055 m_string += m_cresults.format(func1b);
1056 m_string += m_cresults.format(boost::ref(func3b), f);
1057 m_string += m_cresults.format(boost::ref(func3b));
1058 m_string += m_cresults.format(boost::ref(func2b), f);
1059 m_string += m_cresults.format(boost::ref(func2b));
1060 m_string += m_cresults.format(boost::ref(func1b), f);
1061 m_string += m_cresults.format(boost::ref(func1b));
1062 m_string += m_cresults.format(boost::cref(func3b), f);
1063 m_string += m_cresults.format(boost::cref(func3b));
1064 m_string += m_cresults.format(boost::cref(func2b), f);
1065 m_string += m_cresults.format(boost::cref(func2b));
1066 m_string += m_cresults.format(boost::cref(func1b), f);
1067 m_string += m_cresults.format(boost::cref(func1b));
1068
1069 out = regex_replace(out, m_in, m_in, ce, func3, f);
1070 out = regex_replace(out, m_in, m_in, ce, func3);
1071 out = regex_replace(out, m_in, m_in, ce, func2, f);
1072 out = regex_replace(out, m_in, m_in, ce, func2);
1073 out = regex_replace(out, m_in, m_in, ce, func1, f);
1074 out = regex_replace(out, m_in, m_in, ce, func1);
1075 out = regex_replace(out, m_in, m_in, ce, boost::ref(func3), f);
1076 out = regex_replace(out, m_in, m_in, ce, boost::ref(func3));
1077 out = regex_replace(out, m_in, m_in, ce, boost::ref(func2), f);
1078 out = regex_replace(out, m_in, m_in, ce, boost::ref(func2));
1079 out = regex_replace(out, m_in, m_in, ce, boost::ref(func1), f);
1080 out = regex_replace(out, m_in, m_in, ce, boost::ref(func1));
1081 out = regex_replace(out, m_in, m_in, ce, boost::cref(func3), f);
1082 out = regex_replace(out, m_in, m_in, ce, boost::cref(func3));
1083 out = regex_replace(out, m_in, m_in, ce, boost::cref(func2), f);
1084 out = regex_replace(out, m_in, m_in, ce, boost::cref(func2));
1085 out = regex_replace(out, m_in, m_in, ce, boost::cref(func1), f);
1086 out = regex_replace(out, m_in, m_in, ce, boost::cref(func1));
1087
1088 functor3<match_results<typename string_type::const_iterator> > func3s;
1089 functor2<match_results<typename string_type::const_iterator> > func2s;
1090 functor1<match_results<typename string_type::const_iterator> > func1s;
1091 m_string += regex_replace(m_string, ce, func3s, f);
1092 m_string += regex_replace(m_string, ce, func3s);
1093 m_string += regex_replace(m_string, ce, func2s, f);
1094 m_string += regex_replace(m_string, ce, func2s);
1095 m_string += regex_replace(m_string, ce, func1s, f);
1096 m_string += regex_replace(m_string, ce, func1s);
1097 m_string += regex_replace(m_string, ce, boost::ref(func3s), f);
1098 m_string += regex_replace(m_string, ce, boost::ref(func3s));
1099 m_string += regex_replace(m_string, ce, boost::ref(func2s), f);
1100 m_string += regex_replace(m_string, ce, boost::ref(func2s));
1101 m_string += regex_replace(m_string, ce, boost::ref(func1s), f);
1102 m_string += regex_replace(m_string, ce, boost::ref(func1s));
1103 m_string += regex_replace(m_string, ce, boost::cref(func3s), f);
1104 m_string += regex_replace(m_string, ce, boost::cref(func3s));
1105 m_string += regex_replace(m_string, ce, boost::cref(func2s), f);
1106 m_string += regex_replace(m_string, ce, boost::cref(func2s));
1107 m_string += regex_replace(m_string, ce, boost::cref(func1s), f);
1108 m_string += regex_replace(m_string, ce, boost::cref(func1s));
1109 }
1110
1111 std::basic_ostream<value_type> m_stream;
1112 sub_match_type m_sub;
1113 pointer_type m_pointer;
1114 string_type m_string;
1115 const value_type m_char;
1116 match_results_type m_results;
1117 const match_results_type m_cresults;
1118 BidiIterator m_in;
1119
1120 BoostRegexConcept();
1121 BoostRegexConcept(const BoostRegexConcept&);
1122 BoostRegexConcept& operator=(const BoostRegexConcept&);
1123 };
1124
1125 #endif // BOOST_REGEX_TEST_STD
1126
1127 }
1128
1129 #endif
1130