Explicit namespace qualification added to std::distance calls

(hoping to resolve vc7 problem)


[SVN r24953]
This commit is contained in:
Pavol Droba
2004-09-07 10:30:41 +00:00
parent 56862b0bcc
commit 4d346d43ad
2 changed files with 50 additions and 50 deletions

View File

@ -48,18 +48,18 @@ void find_test()
nc_result=find_first( str1, string("abc") );
BOOST_CHECK(
(distance<string::const_iterator>( str1.begin(),nc_result.begin()) == 3) &&
(distance<string::const_iterator>( str1.begin(),nc_result.end()) == 6) );
(std::distance<string::const_iterator>( str1.begin(),nc_result.begin()) == 3) &&
(std::distance<string::const_iterator>( str1.begin(),nc_result.end()) == 6) );
cv_result=find_first( const_cast<const string&>(str1), str2 );
BOOST_CHECK(
(distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 3) &&
(distance<string::const_iterator>( str1.begin(),cv_result.end()) == 6) );
(std::distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 3) &&
(std::distance<string::const_iterator>( str1.begin(),cv_result.end()) == 6) );
cv_result=ifind_first( const_cast<const string&>(str1), "xXX" );
BOOST_CHECK(
(distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 6) &&
(distance<string::const_iterator>( str1.begin(),cv_result.end()) == 9) );
(std::distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 6) &&
(std::distance<string::const_iterator>( 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<string::const_iterator>( str1.begin(),nc_result.begin()) == 15) &&
(distance<string::const_iterator>( str1.begin(),nc_result.end()) == 18) );
(std::distance<string::const_iterator>( str1.begin(),nc_result.begin()) == 15) &&
(std::distance<string::const_iterator>( str1.begin(),nc_result.end()) == 18) );
cv_result=find_last( const_cast<const string&>(str1), str2 );
BOOST_CHECK(
(distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 15) &&
(distance<string::const_iterator>( str1.begin(),cv_result.end()) == 18) );
(std::distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 15) &&
(std::distance<string::const_iterator>( str1.begin(),cv_result.end()) == 18) );
cv_result=ifind_last( const_cast<const string&>(str1), "XXx" );
BOOST_CHECK(
(distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 12) &&
(distance<string::const_iterator>( str1.begin(),cv_result.end()) == 15) );
(std::distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 12) &&
(std::distance<string::const_iterator>( 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<string::const_iterator>( str1.begin(),nc_result.begin()) == 9) &&
(distance<string::const_iterator>( str1.begin(),nc_result.end()) == 12) );
(std::distance<string::const_iterator>( str1.begin(),nc_result.begin()) == 9) &&
(std::distance<string::const_iterator>( str1.begin(),nc_result.end()) == 12) );
cv_result=find_nth( const_cast<const string&>(str1), str2, 1 );
BOOST_CHECK(
(distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 9) &&
(distance<string::const_iterator>( str1.begin(),cv_result.end()) == 12) );
(std::distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 9) &&
(std::distance<string::const_iterator>( str1.begin(),cv_result.end()) == 12) );
cv_result=ifind_nth( const_cast<const string&>(str1), "xxx", 1 );
BOOST_CHECK(
(distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 12) &&
(distance<string::const_iterator>( str1.begin(),cv_result.end()) == 15) );
(std::distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 12) &&
(std::distance<string::const_iterator>( 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<string::const_iterator>( str1.begin(),nc_result.begin()) == 0) &&
(distance<string::const_iterator>( str1.begin(),nc_result.end()) == 6) );
(std::distance<string::const_iterator>( str1.begin(),nc_result.begin()) == 0) &&
(std::distance<string::const_iterator>( str1.begin(),nc_result.end()) == 6) );
cv_result=find_head( const_cast<const string&>(str1), 6 );
BOOST_CHECK(
(distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 0) &&
(distance<string::const_iterator>( str1.begin(),cv_result.end()) == 6) );
(std::distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 0) &&
(std::distance<string::const_iterator>( 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<string::const_iterator>( str1.begin(),nc_result.begin()) == 15) &&
(distance<string::const_iterator>( str1.begin(),nc_result.end()) == 21) );
(std::distance<string::const_iterator>( str1.begin(),nc_result.begin()) == 15) &&
(std::distance<string::const_iterator>( str1.begin(),nc_result.end()) == 21) );
cv_result=find_tail( const_cast<const string&>(str1), 6 );
BOOST_CHECK(
(distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 15) &&
(distance<string::const_iterator>( str1.begin(),cv_result.end()) == 21) );
(std::distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 15) &&
(std::distance<string::const_iterator>( 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<string::const_iterator>( str1.begin(),nc_result.begin()) == 3) &&
(distance<string::const_iterator>( str1.begin(),nc_result.end()) == 6) );
(std::distance<string::const_iterator>( str1.begin(),nc_result.begin()) == 3) &&
(std::distance<string::const_iterator>( str1.begin(),nc_result.end()) == 6) );
cv_result=find_token( const_cast<const string&>(str1), is_any_of("abc"), token_compress_on );
BOOST_CHECK(
(distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 3) &&
(distance<string::const_iterator>( str1.begin(),cv_result.end()) == 6) );
(std::distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 3) &&
(std::distance<string::const_iterator>( str1.begin(),cv_result.end()) == 6) );
nc_result=find_token( str1, is_any_of("abc"), token_compress_off );
BOOST_CHECK(
(distance<string::const_iterator>( str1.begin(),nc_result.begin()) == 3) &&
(distance<string::const_iterator>( str1.begin(),nc_result.end()) == 4) );
(std::distance<string::const_iterator>( str1.begin(),nc_result.begin()) == 3) &&
(std::distance<string::const_iterator>( str1.begin(),nc_result.end()) == 4) );
cv_result=find_token( const_cast<const string&>(str1), is_any_of("abc"), token_compress_off );
BOOST_CHECK(
(distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 3) &&
(distance<string::const_iterator>( str1.begin(),cv_result.end()) == 4) );
(std::distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 3) &&
(std::distance<string::const_iterator>( 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<string::const_iterator>( str1.begin(),nc_result.begin()) == 3) &&
(distance<string::const_iterator>( str1.begin(),nc_result.end()) == 6) );
(std::distance<string::const_iterator>( str1.begin(),nc_result.begin()) == 3) &&
(std::distance<string::const_iterator>( str1.begin(),nc_result.end()) == 6) );
cv_result=find(const_cast<const string&>(str1), first_finder(str2) );
BOOST_CHECK(
(distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 3) &&
(distance<string::const_iterator>( str1.begin(),cv_result.end()) == 6) );
(std::distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 3) &&
(std::distance<string::const_iterator>( str1.begin(),cv_result.end()) == 6) );
// multi-type comparison test
BOOST_CHECKPOINT( "multi-type" );
nc_vresult=find_first( vec1, string("abc") );
BOOST_CHECK(
(distance<vector<int>::const_iterator>( vec1.begin(),nc_vresult.begin()) == 3) &&
(distance<vector<int>::const_iterator>( vec1.begin(),nc_vresult.end()) == 6) );
(std::distance<vector<int>::const_iterator>( vec1.begin(),nc_vresult.begin()) == 3) &&
(std::distance<vector<int>::const_iterator>( vec1.begin(),nc_vresult.end()) == 6) );
cv_vresult=find_first( const_cast<const vector<int>&>(vec1), str2 );
BOOST_CHECK(
(distance<vector<int>::const_iterator>( vec1.begin(),cv_vresult.begin()) == 3) &&
(distance<vector<int>::const_iterator>( vec1.begin(),cv_vresult.end()) == 6) );
(std::distance<vector<int>::const_iterator>( vec1.begin(),cv_vresult.begin()) == 3) &&
(std::distance<vector<int>::const_iterator>( vec1.begin(),cv_vresult.end()) == 6) );
// overflow test
BOOST_CHECKPOINT( "overflow" );

View File

@ -42,13 +42,13 @@ static void find_test()
// basic tests
nc_result=find_regex( str1, rx );
BOOST_CHECK(
(distance<string::const_iterator>( str1.begin(),nc_result.begin()) == 3) &&
(distance<string::const_iterator>( str1.begin(),nc_result.end()) == 6) );
(std::distance<string::const_iterator>( str1.begin(),nc_result.begin()) == 3) &&
(std::distance<string::const_iterator>( str1.begin(),nc_result.end()) == 6) );
cv_result=find_regex( str1, rx );
BOOST_CHECK(
(distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 3) &&
(distance<string::const_iterator>( str1.begin(),cv_result.end()) == 6) );
(std::distance<string::const_iterator>( str1.begin(),cv_result.begin()) == 3) &&
(std::distance<string::const_iterator>( 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<vector<int>::const_iterator>( vec1.begin(),nc_vresult.begin()) == 3) &&
(distance<vector<int>::const_iterator>( vec1.begin(),nc_vresult.end()) == 6) );
(std::distance<vector<int>::const_iterator>( vec1.begin(),nc_vresult.begin()) == 3) &&
(std::distance<vector<int>::const_iterator>( vec1.begin(),nc_vresult.end()) == 6) );
cv_vresult=find_regex( vec1, rx );
BOOST_CHECK(
(distance<vector<int>::const_iterator>( vec1.begin(),cv_vresult.begin()) == 3) &&
(distance<vector<int>::const_iterator>( vec1.begin(),cv_vresult.end()) == 6) );
(std::distance<vector<int>::const_iterator>( vec1.begin(),cv_vresult.begin()) == 3) &&
(std::distance<vector<int>::const_iterator>( vec1.begin(),cv_vresult.end()) == 6) );
// find_all_regex test
find_all_regex( tokens, str1, rx );