forked from boostorg/regex
Update TR1 library to cope with GCC-4.3 in C++0x mode, and in TR1 mode.
Updated regex concepts to match the TR1. Added "tricky" cmath_test to test for the functions Boost doesn't implement. [SVN r48413]
This commit is contained in:
@ -87,12 +87,12 @@ struct regex_traits_architype
|
|||||||
public:
|
public:
|
||||||
regex_traits_architype();
|
regex_traits_architype();
|
||||||
typedef charT char_type;
|
typedef charT char_type;
|
||||||
typedef std::size_t size_type;
|
// typedef std::size_t size_type;
|
||||||
typedef std::vector<char_type> string_type;
|
typedef std::vector<char_type> string_type;
|
||||||
typedef copy_constructible_archetype<assignable_archetype<> > locale_type;
|
typedef copy_constructible_archetype<assignable_archetype<> > locale_type;
|
||||||
typedef bitmask_archetype char_class_type;
|
typedef bitmask_archetype char_class_type;
|
||||||
|
|
||||||
static size_type length(const char_type* ) { return 0; }
|
static std::size_t length(const char_type* ) { return 0; }
|
||||||
|
|
||||||
charT translate(charT ) const { return charT(); }
|
charT translate(charT ) const { return charT(); }
|
||||||
charT translate_nocase(charT ) const { return static_object<charT>::get(); }
|
charT translate_nocase(charT ) const { return static_object<charT>::get(); }
|
||||||
@ -163,21 +163,21 @@ struct RegexTraitsConcept
|
|||||||
RegexTraitsConcept();
|
RegexTraitsConcept();
|
||||||
// required typedefs:
|
// required typedefs:
|
||||||
typedef typename traits::char_type char_type;
|
typedef typename traits::char_type char_type;
|
||||||
typedef typename traits::size_type size_type;
|
// typedef typename traits::size_type size_type;
|
||||||
typedef typename traits::string_type string_type;
|
typedef typename traits::string_type string_type;
|
||||||
typedef typename traits::locale_type locale_type;
|
typedef typename traits::locale_type locale_type;
|
||||||
typedef typename traits::char_class_type char_class_type;
|
typedef typename traits::char_class_type char_class_type;
|
||||||
|
|
||||||
void constraints()
|
void constraints()
|
||||||
{
|
{
|
||||||
function_requires<UnsignedIntegerConcept<size_type> >();
|
//function_requires<UnsignedIntegerConcept<size_type> >();
|
||||||
function_requires<RandomAccessContainerConcept<string_type> >();
|
function_requires<RandomAccessContainerConcept<string_type> >();
|
||||||
function_requires<DefaultConstructibleConcept<locale_type> >();
|
function_requires<DefaultConstructibleConcept<locale_type> >();
|
||||||
function_requires<CopyConstructibleConcept<locale_type> >();
|
function_requires<CopyConstructibleConcept<locale_type> >();
|
||||||
function_requires<AssignableConcept<locale_type> >();
|
function_requires<AssignableConcept<locale_type> >();
|
||||||
function_requires<BitmaskConcept<char_class_type> >();
|
function_requires<BitmaskConcept<char_class_type> >();
|
||||||
|
|
||||||
size_type n = traits::length(m_pointer);
|
std::size_t n = traits::length(m_pointer);
|
||||||
ignore_unused_variable_warning(n);
|
ignore_unused_variable_warning(n);
|
||||||
|
|
||||||
char_type c = m_ctraits.translate(m_char);
|
char_type c = m_ctraits.translate(m_char);
|
||||||
|
@ -191,7 +191,7 @@ class basic_regex : public regbase
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// typedefs:
|
// typedefs:
|
||||||
typedef typename traits::size_type traits_size_type;
|
typedef std::size_t traits_size_type;
|
||||||
typedef typename traits::string_type traits_string_type;
|
typedef typename traits::string_type traits_string_type;
|
||||||
typedef charT char_type;
|
typedef charT char_type;
|
||||||
typedef traits traits_type;
|
typedef traits traits_type;
|
||||||
|
@ -331,7 +331,7 @@ public:
|
|||||||
typedef typename traits::char_type char_type;
|
typedef typename traits::char_type char_type;
|
||||||
typedef perl_matcher<BidiIterator, Allocator, traits> self_type;
|
typedef perl_matcher<BidiIterator, Allocator, traits> self_type;
|
||||||
typedef bool (self_type::*matcher_proc_type)(void);
|
typedef bool (self_type::*matcher_proc_type)(void);
|
||||||
typedef typename traits::size_type traits_size_type;
|
typedef std::size_t traits_size_type;
|
||||||
typedef typename is_byte<char_type>::width_type width_type;
|
typedef typename is_byte<char_type>::width_type width_type;
|
||||||
typedef typename regex_iterator_traits<BidiIterator>::difference_type difference_type;
|
typedef typename regex_iterator_traits<BidiIterator>::difference_type difference_type;
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ int test_main( int , char* [] )
|
|||||||
|
|
||||||
bad_text.assign((std::string::size_type)500000, 'a');
|
bad_text.assign((std::string::size_type)500000, 'a');
|
||||||
e2.assign("aaa*@");
|
e2.assign("aaa*@");
|
||||||
BOOST_CHECK_THROW(0 == boost::regex_search(bad_text, what, e2), std::runtime_error);
|
BOOST_CHECK_THROW(boost::regex_search(bad_text, what, e2), std::runtime_error);
|
||||||
good_text.assign((std::string::size_type)5000, 'a');
|
good_text.assign((std::string::size_type)5000, 'a');
|
||||||
BOOST_CHECK(0 == boost::regex_search(good_text, what, e2));
|
BOOST_CHECK(0 == boost::regex_search(good_text, what, e2));
|
||||||
|
|
||||||
@ -54,3 +54,4 @@ int test_main( int , char* [] )
|
|||||||
}
|
}
|
||||||
|
|
||||||
#include <boost/test/included/test_exec_monitor.hpp>
|
#include <boost/test/included/test_exec_monitor.hpp>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user