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:
John Maddock
2008-08-28 11:02:59 +00:00
parent 1297f92b8a
commit 4212c0d915
4 changed files with 9 additions and 8 deletions

View File

@ -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<char_type> string_type;
typedef copy_constructible_archetype<assignable_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<charT>::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<UnsignedIntegerConcept<size_type> >();
//function_requires<UnsignedIntegerConcept<size_type> >();
function_requires<RandomAccessContainerConcept<string_type> >();
function_requires<DefaultConstructibleConcept<locale_type> >();
function_requires<CopyConstructibleConcept<locale_type> >();
function_requires<AssignableConcept<locale_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);
char_type c = m_ctraits.translate(m_char);

View File

@ -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;

View File

@ -331,7 +331,7 @@ public:
typedef typename traits::char_type char_type;
typedef perl_matcher<BidiIterator, Allocator, traits> 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<char_type>::width_type width_type;
typedef typename regex_iterator_traits<BidiIterator>::difference_type difference_type;

View File

@ -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 <boost/test/included/test_exec_monitor.hpp>