typedef boost::char_architype char_type;
};
}
+//
+// Allocator architype:
+//
+template <class T>
+class allocator_architype
+{
+public:
+ typedef T* pointer;
+ typedef const T* const_pointer;
+ typedef T& reference;
+ typedef const T& const_reference;
+ typedef T value_type;
+ typedef unsigned size_type;
+ typedef int difference_type;
+
+ template <class U>
+ struct rebind
+ {
+ typedef allocator_architype<U> other;
+ };
+
+ pointer address(reference r);
+ const_pointer address(const_reference r);
+ pointer allocate(size_type);
+ pointer allocate(size_type, pointer);
+ void deallocate(pointer, size_type);
+ size_type max_size()const;
+
+ allocator_architype();
+ allocator_architype(const allocator_architype&);
+
+ template <class Other>
+ allocator_architype(const allocator_architype<Other>&);
+
+ void construct(pointer, const_reference);
+ void destroy(pointer);
+};
+
+template <class T>
+bool operator == (const allocator_architype<T>&, const allocator_architype<T>&);
+template <class T>
+bool operator != (const allocator_architype<T>&, const allocator_architype<T>&);
+
namespace boost{
//
// regex_traits_architype:
typedef const value_type* pointer_type;
typedef bidirectional_iterator_archetype<value_type> BidiIterator;
typedef global_regex_namespace::sub_match<BidiIterator> sub_match_type;
- typedef global_regex_namespace::match_results<BidiIterator> match_results_type;
+ typedef global_regex_namespace::match_results<BidiIterator, allocator_architype<sub_match_type> > match_results_type;
+ typedef global_regex_namespace::match_results<BidiIterator> match_results_default_type;
typedef output_iterator_archetype<value_type> OutIterator;
typedef typename regex_traits_computer<Regex>::type traits_type;
typedef global_regex_namespace::regex_iterator<BidiIterator, value_type, traits_type> regex_iterator_type;
const global_regex_namespace::regex_error except(e1);
e1 = except.code();
- typedef typename Regex::value_type value_type;
+ typedef typename Regex::value_type regex_value_type;
function_requires< RegexTraitsConcept<global_regex_namespace::regex_traits<char> > >();
function_requires< BaseRegexConcept<global_regex_namespace::basic_regex<char> > >();
}
typedef typename regex_iterator_type::reference rit_reference;
typedef typename regex_iterator_type::iterator_category rit_iterator_category;
BOOST_STATIC_ASSERT((::boost::is_same<rit_regex_type, Regex>::value));
- BOOST_STATIC_ASSERT((::boost::is_same<rit_value_type, match_results_type>::value));
+ BOOST_STATIC_ASSERT((::boost::is_same<rit_value_type, match_results_default_type>::value));
BOOST_STATIC_ASSERT((::boost::is_same<rit_difference_type, std::ptrdiff_t>::value));
- BOOST_STATIC_ASSERT((::boost::is_same<rit_pointer, const match_results_type*>::value));
- BOOST_STATIC_ASSERT((::boost::is_same<rit_reference, const match_results_type&>::value));
+ BOOST_STATIC_ASSERT((::boost::is_same<rit_pointer, const match_results_default_type*>::value));
+ BOOST_STATIC_ASSERT((::boost::is_same<rit_reference, const match_results_default_type&>::value));
BOOST_STATIC_ASSERT((::boost::is_convertible<rit_iterator_category*, std::forward_iterator_tag*>::value));
// this takes care of most of the checks needed:
function_requires<ForwardIteratorConcept<regex_iterator_type> >();
OutIterator m_out;
BidiIterator m_in;
global_regex_namespace::regex_constants::match_flag_type m_mft;
- global_regex_namespace::match_results<pointer_type> m_pmatch;
+ global_regex_namespace::match_results<
+ pointer_type,
+ allocator_architype<global_regex_namespace::sub_match<pointer_type> > >
+ m_pmatch;
BaseRegexConcept();
BaseRegexConcept(const BaseRegexConcept&);
typedef std::basic_string<value_type> string_type;
typedef boost::bidirectional_iterator_archetype<value_type> BidiIterator;
typedef global_regex_namespace::sub_match<BidiIterator> sub_match_type;
- typedef global_regex_namespace::match_results<BidiIterator> match_results_type;
+ typedef global_regex_namespace::match_results<BidiIterator, allocator_architype<sub_match_type> > match_results_type;
typedef output_iterator_archetype<value_type> OutIterator;
OutIterator m_out;
BidiIterator m_in;
global_regex_namespace::regex_constants::match_flag_type m_mft;
- global_regex_namespace::match_results<typename string_type::const_iterator> m_smatch;
+ global_regex_namespace::match_results<typename string_type::const_iterator, allocator_architype<global_regex_namespace::sub_match<typename string_type::const_iterator> > > m_smatch;
RegexConcept();
RegexConcept(const RegexConcept&);
struct functor1
{
typedef typename M::char_type char_type;
- const char_type* operator()(const M&)
+ const char_type* operator()(const M&)const
{
static const char_type c = static_cast<char_type>(0);
return &c;
struct functor1b
{
typedef typename M::char_type char_type;
- std::vector<char_type> operator()(const M&)
+ std::vector<char_type> operator()(const M&)const
{
static const std::vector<char_type> c;
return c;
struct functor2
{
template <class O>
- O operator()(const M& /*m*/, O i)
+ O operator()(const M& /*m*/, O i)const
{
return i;
}
struct functor3
{
template <class O>
- O operator()(const M& /*m*/, O i, regex_constants::match_flag_type)
+ O operator()(const M& /*m*/, O i, regex_constants::match_flag_type)const
{
return i;
}
typedef bidirectional_iterator_archetype<value_type> BidiIterator;
typedef output_iterator_archetype<value_type> OutputIterator;
typedef global_regex_namespace::sub_match<BidiIterator> sub_match_type;
- typedef global_regex_namespace::match_results<BidiIterator> match_results_type;
+ typedef global_regex_namespace::match_results<BidiIterator, allocator_architype<sub_match_type> > match_results_type;
+ typedef global_regex_namespace::match_results<BidiIterator> match_results_default_type;
void constraints()
{
//
regex_constants::match_flag_type f = regex_constants::match_default;
OutputIterator out = static_object<OutputIterator>::get();
- functor3<match_results_type> func3;
- out = regex_format(out, m_cresults, func3, f);
- out = regex_format(out, m_cresults, func3);
- functor2<match_results_type> func2;
- out = regex_format(out, m_cresults, func2, f);
- out = regex_format(out, m_cresults, func2);
- functor1<match_results_type> func1;
- out = regex_format(out, m_cresults, func1, f);
- out = regex_format(out, m_cresults, func1);
-
- m_string += regex_format(m_cresults, func3, f);
- m_string += regex_format(m_cresults, func3);
- m_string += regex_format(m_cresults, func2, f);
- m_string += regex_format(m_cresults, func2);
- m_string += regex_format(m_cresults, func1, f);
- m_string += regex_format(m_cresults, func1);
-
- out = m_cresults.format(out, func3, f);
- out = m_cresults.format(out, func3);
- out = m_cresults.format(out, func2, f);
- out = m_cresults.format(out, func2);
- out = m_cresults.format(out, func1, f);
- out = m_cresults.format(out, func1);
-
- m_string += m_cresults.format(func3, f);
- m_string += m_cresults.format(func3);
- m_string += m_cresults.format(func2, f);
- m_string += m_cresults.format(func2);
- m_string += m_cresults.format(func1, f);
- m_string += m_cresults.format(func1);
+
+ functor3<match_results_default_type> func3;
+ functor2<match_results_default_type> func2;
+ functor1<match_results_default_type> func1;
+
+ functor3<match_results_type> func3b;
+ functor2<match_results_type> func2b;
+ functor1<match_results_type> func1b;
+
+ out = regex_format(out, m_cresults, func3b, f);
+ out = regex_format(out, m_cresults, func3b);
+ out = regex_format(out, m_cresults, func2b, f);
+ out = regex_format(out, m_cresults, func2b);
+ out = regex_format(out, m_cresults, func1b, f);
+ out = regex_format(out, m_cresults, func1b);
+ out = regex_format(out, m_cresults, boost::ref(func3b), f);
+ out = regex_format(out, m_cresults, boost::ref(func3b));
+ out = regex_format(out, m_cresults, boost::ref(func2b), f);
+ out = regex_format(out, m_cresults, boost::ref(func2b));
+ out = regex_format(out, m_cresults, boost::ref(func1b), f);
+ out = regex_format(out, m_cresults, boost::ref(func1b));
+ out = regex_format(out, m_cresults, boost::cref(func3b), f);
+ out = regex_format(out, m_cresults, boost::cref(func3b));
+ out = regex_format(out, m_cresults, boost::cref(func2b), f);
+ out = regex_format(out, m_cresults, boost::cref(func2b));
+ out = regex_format(out, m_cresults, boost::cref(func1b), f);
+ out = regex_format(out, m_cresults, boost::cref(func1b));
+
+ m_string += regex_format(m_cresults, func3b, f);
+ m_string += regex_format(m_cresults, func3b);
+ m_string += regex_format(m_cresults, func2b, f);
+ m_string += regex_format(m_cresults, func2b);
+ m_string += regex_format(m_cresults, func1b, f);
+ m_string += regex_format(m_cresults, func1b);
+ m_string += regex_format(m_cresults, boost::ref(func3b), f);
+ m_string += regex_format(m_cresults, boost::ref(func3b));
+ m_string += regex_format(m_cresults, boost::ref(func2b), f);
+ m_string += regex_format(m_cresults, boost::ref(func2b));
+ m_string += regex_format(m_cresults, boost::ref(func1b), f);
+ m_string += regex_format(m_cresults, boost::ref(func1b));
+ m_string += regex_format(m_cresults, boost::cref(func3b), f);
+ m_string += regex_format(m_cresults, boost::cref(func3b));
+ m_string += regex_format(m_cresults, boost::cref(func2b), f);
+ m_string += regex_format(m_cresults, boost::cref(func2b));
+ m_string += regex_format(m_cresults, boost::cref(func1b), f);
+ m_string += regex_format(m_cresults, boost::cref(func1b));
+
+ out = m_cresults.format(out, func3b, f);
+ out = m_cresults.format(out, func3b);
+ out = m_cresults.format(out, func2b, f);
+ out = m_cresults.format(out, func2b);
+ out = m_cresults.format(out, func1b, f);
+ out = m_cresults.format(out, func1b);
+ out = m_cresults.format(out, boost::ref(func3b), f);
+ out = m_cresults.format(out, boost::ref(func3b));
+ out = m_cresults.format(out, boost::ref(func2b), f);
+ out = m_cresults.format(out, boost::ref(func2b));
+ out = m_cresults.format(out, boost::ref(func1b), f);
+ out = m_cresults.format(out, boost::ref(func1b));
+ out = m_cresults.format(out, boost::cref(func3b), f);
+ out = m_cresults.format(out, boost::cref(func3b));
+ out = m_cresults.format(out, boost::cref(func2b), f);
+ out = m_cresults.format(out, boost::cref(func2b));
+ out = m_cresults.format(out, boost::cref(func1b), f);
+ out = m_cresults.format(out, boost::cref(func1b));
+
+ m_string += m_cresults.format(func3b, f);
+ m_string += m_cresults.format(func3b);
+ m_string += m_cresults.format(func2b, f);
+ m_string += m_cresults.format(func2b);
+ m_string += m_cresults.format(func1b, f);
+ m_string += m_cresults.format(func1b);
+ m_string += m_cresults.format(boost::ref(func3b), f);
+ m_string += m_cresults.format(boost::ref(func3b));
+ m_string += m_cresults.format(boost::ref(func2b), f);
+ m_string += m_cresults.format(boost::ref(func2b));
+ m_string += m_cresults.format(boost::ref(func1b), f);
+ m_string += m_cresults.format(boost::ref(func1b));
+ m_string += m_cresults.format(boost::cref(func3b), f);
+ m_string += m_cresults.format(boost::cref(func3b));
+ m_string += m_cresults.format(boost::cref(func2b), f);
+ m_string += m_cresults.format(boost::cref(func2b));
+ m_string += m_cresults.format(boost::cref(func1b), f);
+ m_string += m_cresults.format(boost::cref(func1b));
out = regex_replace(out, m_in, m_in, ce, func3, f);
out = regex_replace(out, m_in, m_in, ce, func3);
out = regex_replace(out, m_in, m_in, ce, func2);
out = regex_replace(out, m_in, m_in, ce, func1, f);
out = regex_replace(out, m_in, m_in, ce, func1);
+ out = regex_replace(out, m_in, m_in, ce, boost::ref(func3), f);
+ out = regex_replace(out, m_in, m_in, ce, boost::ref(func3));
+ out = regex_replace(out, m_in, m_in, ce, boost::ref(func2), f);
+ out = regex_replace(out, m_in, m_in, ce, boost::ref(func2));
+ out = regex_replace(out, m_in, m_in, ce, boost::ref(func1), f);
+ out = regex_replace(out, m_in, m_in, ce, boost::ref(func1));
+ out = regex_replace(out, m_in, m_in, ce, boost::cref(func3), f);
+ out = regex_replace(out, m_in, m_in, ce, boost::cref(func3));
+ out = regex_replace(out, m_in, m_in, ce, boost::cref(func2), f);
+ out = regex_replace(out, m_in, m_in, ce, boost::cref(func2));
+ out = regex_replace(out, m_in, m_in, ce, boost::cref(func1), f);
+ out = regex_replace(out, m_in, m_in, ce, boost::cref(func1));
functor3<match_results<typename string_type::const_iterator> > func3s;
functor2<match_results<typename string_type::const_iterator> > func2s;
m_string += regex_replace(m_string, ce, func2s);
m_string += regex_replace(m_string, ce, func1s, f);
m_string += regex_replace(m_string, ce, func1s);
+ m_string += regex_replace(m_string, ce, boost::ref(func3s), f);
+ m_string += regex_replace(m_string, ce, boost::ref(func3s));
+ m_string += regex_replace(m_string, ce, boost::ref(func2s), f);
+ m_string += regex_replace(m_string, ce, boost::ref(func2s));
+ m_string += regex_replace(m_string, ce, boost::ref(func1s), f);
+ m_string += regex_replace(m_string, ce, boost::ref(func1s));
+ m_string += regex_replace(m_string, ce, boost::cref(func3s), f);
+ m_string += regex_replace(m_string, ce, boost::cref(func3s));
+ m_string += regex_replace(m_string, ce, boost::cref(func2s), f);
+ m_string += regex_replace(m_string, ce, boost::cref(func2s));
+ m_string += regex_replace(m_string, ce, boost::cref(func1s), f);
+ m_string += regex_replace(m_string, ce, boost::cref(func1s));
}
std::basic_ostream<value_type> m_stream;