/Src/Dependencies/Boost/boost/regex/concepts.hpp

http://hadesmem.googlecode.com/ · C++ Header · 1126 lines · 922 code · 106 blank · 98 comment · 18 complexity · c7dd6ff05f21807e900da8873039c967 MD5 · raw file

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