From 4d346d43ad60ddf75d3605728b506a88c4978bde Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Tue, 7 Sep 2004 10:30:41 +0000 Subject: [PATCH] Explicit namespace qualification added to std::distance calls (hoping to resolve vc7 problem) [SVN r24953] --- string/test/find_test.cpp | 84 +++++++++++++++++++------------------- string/test/regex_test.cpp | 16 ++++---- 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/string/test/find_test.cpp b/string/test/find_test.cpp index 417e286..ee7232e 100644 --- a/string/test/find_test.cpp +++ b/string/test/find_test.cpp @@ -48,18 +48,18 @@ void find_test() nc_result=find_first( str1, string("abc") ); BOOST_CHECK( - (distance( str1.begin(),nc_result.begin()) == 3) && - (distance( str1.begin(),nc_result.end()) == 6) ); + (std::distance( str1.begin(),nc_result.begin()) == 3) && + (std::distance( str1.begin(),nc_result.end()) == 6) ); cv_result=find_first( const_cast(str1), str2 ); BOOST_CHECK( - (distance( str1.begin(),cv_result.begin()) == 3) && - (distance( str1.begin(),cv_result.end()) == 6) ); + (std::distance( str1.begin(),cv_result.begin()) == 3) && + (std::distance( str1.begin(),cv_result.end()) == 6) ); cv_result=ifind_first( const_cast(str1), "xXX" ); BOOST_CHECK( - (distance( str1.begin(),cv_result.begin()) == 6) && - (distance( str1.begin(),cv_result.end()) == 9) ); + (std::distance( str1.begin(),cv_result.begin()) == 6) && + (std::distance( str1.begin(),cv_result.end()) == 9) ); ch_result=find_first( pch1, "abc" ); BOOST_CHECK(( (ch_result.begin() - pch1 ) == 3) && ( (ch_result.end() - pch1 ) == 6 ) ); @@ -69,18 +69,18 @@ void find_test() nc_result=find_last( str1, string("abc") ); BOOST_CHECK( - (distance( str1.begin(),nc_result.begin()) == 15) && - (distance( str1.begin(),nc_result.end()) == 18) ); + (std::distance( str1.begin(),nc_result.begin()) == 15) && + (std::distance( str1.begin(),nc_result.end()) == 18) ); cv_result=find_last( const_cast(str1), str2 ); BOOST_CHECK( - (distance( str1.begin(),cv_result.begin()) == 15) && - (distance( str1.begin(),cv_result.end()) == 18) ); + (std::distance( str1.begin(),cv_result.begin()) == 15) && + (std::distance( str1.begin(),cv_result.end()) == 18) ); cv_result=ifind_last( const_cast(str1), "XXx" ); BOOST_CHECK( - (distance( str1.begin(),cv_result.begin()) == 12) && - (distance( str1.begin(),cv_result.end()) == 15) ); + (std::distance( str1.begin(),cv_result.begin()) == 12) && + (std::distance( str1.begin(),cv_result.end()) == 15) ); ch_result=find_last( pch1, "abc" ); BOOST_CHECK(( (ch_result.begin() - pch1 ) == 15) && ( (ch_result.end() - pch1 ) == 18 ) ); @@ -90,18 +90,18 @@ void find_test() nc_result=find_nth( str1, string("abc"), 1 ); BOOST_CHECK( - (distance( str1.begin(),nc_result.begin()) == 9) && - (distance( str1.begin(),nc_result.end()) == 12) ); + (std::distance( str1.begin(),nc_result.begin()) == 9) && + (std::distance( str1.begin(),nc_result.end()) == 12) ); cv_result=find_nth( const_cast(str1), str2, 1 ); BOOST_CHECK( - (distance( str1.begin(),cv_result.begin()) == 9) && - (distance( str1.begin(),cv_result.end()) == 12) ); + (std::distance( str1.begin(),cv_result.begin()) == 9) && + (std::distance( str1.begin(),cv_result.end()) == 12) ); cv_result=ifind_nth( const_cast(str1), "xxx", 1 ); BOOST_CHECK( - (distance( str1.begin(),cv_result.begin()) == 12) && - (distance( str1.begin(),cv_result.end()) == 15) ); + (std::distance( str1.begin(),cv_result.begin()) == 12) && + (std::distance( str1.begin(),cv_result.end()) == 15) ); ch_result=find_nth( pch1, "abc", 1 ); BOOST_CHECK(( (ch_result.begin() - pch1 ) == 9) && ( (ch_result.end() - pch1 ) == 12 ) ); @@ -111,13 +111,13 @@ void find_test() nc_result=find_head( str1, 6 ); BOOST_CHECK( - (distance( str1.begin(),nc_result.begin()) == 0) && - (distance( str1.begin(),nc_result.end()) == 6) ); + (std::distance( str1.begin(),nc_result.begin()) == 0) && + (std::distance( str1.begin(),nc_result.end()) == 6) ); cv_result=find_head( const_cast(str1), 6 ); BOOST_CHECK( - (distance( str1.begin(),cv_result.begin()) == 0) && - (distance( str1.begin(),cv_result.end()) == 6) ); + (std::distance( str1.begin(),cv_result.begin()) == 0) && + (std::distance( str1.begin(),cv_result.end()) == 6) ); ch_result=find_head( pch1, 6 ); BOOST_CHECK( ( (ch_result.begin() - pch1 ) == 0 ) && ( (ch_result.end() - pch1 ) == 6 ) ); @@ -127,13 +127,13 @@ void find_test() nc_result=find_tail( str1, 6 ); BOOST_CHECK( - (distance( str1.begin(),nc_result.begin()) == 15) && - (distance( str1.begin(),nc_result.end()) == 21) ); + (std::distance( str1.begin(),nc_result.begin()) == 15) && + (std::distance( str1.begin(),nc_result.end()) == 21) ); cv_result=find_tail( const_cast(str1), 6 ); BOOST_CHECK( - (distance( str1.begin(),cv_result.begin()) == 15) && - (distance( str1.begin(),cv_result.end()) == 21) ); + (std::distance( str1.begin(),cv_result.begin()) == 15) && + (std::distance( str1.begin(),cv_result.end()) == 21) ); ch_result=find_tail( pch1, 6 ); BOOST_CHECK( ( (ch_result.begin() - pch1 ) == 15 ) && ( (ch_result.end() - pch1 ) == 21 ) ); @@ -143,23 +143,23 @@ void find_test() nc_result=find_token( str1, is_any_of("abc"), token_compress_on ); BOOST_CHECK( - (distance( str1.begin(),nc_result.begin()) == 3) && - (distance( str1.begin(),nc_result.end()) == 6) ); + (std::distance( str1.begin(),nc_result.begin()) == 3) && + (std::distance( str1.begin(),nc_result.end()) == 6) ); cv_result=find_token( const_cast(str1), is_any_of("abc"), token_compress_on ); BOOST_CHECK( - (distance( str1.begin(),cv_result.begin()) == 3) && - (distance( str1.begin(),cv_result.end()) == 6) ); + (std::distance( str1.begin(),cv_result.begin()) == 3) && + (std::distance( str1.begin(),cv_result.end()) == 6) ); nc_result=find_token( str1, is_any_of("abc"), token_compress_off ); BOOST_CHECK( - (distance( str1.begin(),nc_result.begin()) == 3) && - (distance( str1.begin(),nc_result.end()) == 4) ); + (std::distance( str1.begin(),nc_result.begin()) == 3) && + (std::distance( str1.begin(),nc_result.end()) == 4) ); cv_result=find_token( const_cast(str1), is_any_of("abc"), token_compress_off ); BOOST_CHECK( - (distance( str1.begin(),cv_result.begin()) == 3) && - (distance( str1.begin(),cv_result.end()) == 4) ); + (std::distance( str1.begin(),cv_result.begin()) == 3) && + (std::distance( str1.begin(),cv_result.end()) == 4) ); ch_result=find_token( pch1, is_any_of("abc"), token_compress_off ); BOOST_CHECK( ( (ch_result.begin() - pch1 ) == 3 ) && ( (ch_result.end() - pch1 ) == 4 ) ); @@ -169,26 +169,26 @@ void find_test() nc_result=find(str1, first_finder(string("abc"))); BOOST_CHECK( - (distance( str1.begin(),nc_result.begin()) == 3) && - (distance( str1.begin(),nc_result.end()) == 6) ); + (std::distance( str1.begin(),nc_result.begin()) == 3) && + (std::distance( str1.begin(),nc_result.end()) == 6) ); cv_result=find(const_cast(str1), first_finder(str2) ); BOOST_CHECK( - (distance( str1.begin(),cv_result.begin()) == 3) && - (distance( str1.begin(),cv_result.end()) == 6) ); + (std::distance( str1.begin(),cv_result.begin()) == 3) && + (std::distance( str1.begin(),cv_result.end()) == 6) ); // multi-type comparison test BOOST_CHECKPOINT( "multi-type" ); nc_vresult=find_first( vec1, string("abc") ); BOOST_CHECK( - (distance::const_iterator>( vec1.begin(),nc_vresult.begin()) == 3) && - (distance::const_iterator>( vec1.begin(),nc_vresult.end()) == 6) ); + (std::distance::const_iterator>( vec1.begin(),nc_vresult.begin()) == 3) && + (std::distance::const_iterator>( vec1.begin(),nc_vresult.end()) == 6) ); cv_vresult=find_first( const_cast&>(vec1), str2 ); BOOST_CHECK( - (distance::const_iterator>( vec1.begin(),cv_vresult.begin()) == 3) && - (distance::const_iterator>( vec1.begin(),cv_vresult.end()) == 6) ); + (std::distance::const_iterator>( vec1.begin(),cv_vresult.begin()) == 3) && + (std::distance::const_iterator>( vec1.begin(),cv_vresult.end()) == 6) ); // overflow test BOOST_CHECKPOINT( "overflow" ); diff --git a/string/test/regex_test.cpp b/string/test/regex_test.cpp index 7b9cd00..faf7341 100644 --- a/string/test/regex_test.cpp +++ b/string/test/regex_test.cpp @@ -42,13 +42,13 @@ static void find_test() // basic tests nc_result=find_regex( str1, rx ); BOOST_CHECK( - (distance( str1.begin(),nc_result.begin()) == 3) && - (distance( str1.begin(),nc_result.end()) == 6) ); + (std::distance( str1.begin(),nc_result.begin()) == 3) && + (std::distance( str1.begin(),nc_result.end()) == 6) ); cv_result=find_regex( str1, rx ); BOOST_CHECK( - (distance( str1.begin(),cv_result.begin()) == 3) && - (distance( str1.begin(),cv_result.end()) == 6) ); + (std::distance( str1.begin(),cv_result.begin()) == 3) && + (std::distance( str1.begin(),cv_result.end()) == 6) ); ch_result=find_regex( pch1, rx ); BOOST_CHECK(( (ch_result.begin() - pch1 ) == 3) && ( (ch_result.end() - pch1 ) == 6 ) ); @@ -56,13 +56,13 @@ static void find_test() // multi-type comparison test nc_vresult=find_regex( vec1, rx ); BOOST_CHECK( - (distance::const_iterator>( vec1.begin(),nc_vresult.begin()) == 3) && - (distance::const_iterator>( vec1.begin(),nc_vresult.end()) == 6) ); + (std::distance::const_iterator>( vec1.begin(),nc_vresult.begin()) == 3) && + (std::distance::const_iterator>( vec1.begin(),nc_vresult.end()) == 6) ); cv_vresult=find_regex( vec1, rx ); BOOST_CHECK( - (distance::const_iterator>( vec1.begin(),cv_vresult.begin()) == 3) && - (distance::const_iterator>( vec1.begin(),cv_vresult.end()) == 6) ); + (std::distance::const_iterator>( vec1.begin(),cv_vresult.begin()) == 3) && + (std::distance::const_iterator>( vec1.begin(),cv_vresult.end()) == 6) ); // find_all_regex test find_all_regex( tokens, str1, rx );