From 4212c0d915ea2d5102803d3e0015c47a2e9edf04 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Thu, 28 Aug 2008 11:02:59 +0000 Subject: [PATCH] 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] --- include/boost/regex/concepts.hpp | 10 +++++----- include/boost/regex/v4/basic_regex.hpp | 2 +- include/boost/regex/v4/perl_matcher.hpp | 2 +- test/pathology/bad_expression_test.cpp | 3 ++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/boost/regex/concepts.hpp b/include/boost/regex/concepts.hpp index 99c6eea5..0a22aebd 100644 --- a/include/boost/regex/concepts.hpp +++ b/include/boost/regex/concepts.hpp @@ -87,12 +87,12 @@ struct regex_traits_architype public: regex_traits_architype(); typedef charT char_type; - typedef std::size_t size_type; + // typedef std::size_t size_type; typedef std::vector string_type; typedef copy_constructible_archetype > locale_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_nocase(charT ) const { return static_object::get(); } @@ -163,21 +163,21 @@ struct RegexTraitsConcept RegexTraitsConcept(); // required typedefs: 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::locale_type locale_type; typedef typename traits::char_class_type char_class_type; void constraints() { - function_requires >(); + //function_requires >(); function_requires >(); function_requires >(); function_requires >(); function_requires >(); function_requires >(); - size_type n = traits::length(m_pointer); + std::size_t n = traits::length(m_pointer); ignore_unused_variable_warning(n); char_type c = m_ctraits.translate(m_char); diff --git a/include/boost/regex/v4/basic_regex.hpp b/include/boost/regex/v4/basic_regex.hpp index 2a8c0c6c..018a30f9 100644 --- a/include/boost/regex/v4/basic_regex.hpp +++ b/include/boost/regex/v4/basic_regex.hpp @@ -191,7 +191,7 @@ class basic_regex : public regbase { public: // 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 charT char_type; typedef traits traits_type; diff --git a/include/boost/regex/v4/perl_matcher.hpp b/include/boost/regex/v4/perl_matcher.hpp index 547cb24a..66c2d007 100644 --- a/include/boost/regex/v4/perl_matcher.hpp +++ b/include/boost/regex/v4/perl_matcher.hpp @@ -331,7 +331,7 @@ public: typedef typename traits::char_type char_type; typedef perl_matcher self_type; 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::width_type width_type; typedef typename regex_iterator_traits::difference_type difference_type; diff --git a/test/pathology/bad_expression_test.cpp b/test/pathology/bad_expression_test.cpp index 308df422..34f21c22 100644 --- a/test/pathology/bad_expression_test.cpp +++ b/test/pathology/bad_expression_test.cpp @@ -46,7 +46,7 @@ int test_main( int , char* [] ) bad_text.assign((std::string::size_type)500000, 'a'); 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'); BOOST_CHECK(0 == boost::regex_search(good_text, what, e2)); @@ -54,3 +54,4 @@ int test_main( int , char* [] ) } #include +