From aa01efb72239815255281f95416885ce22241915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20J=C3=B8rgen=20Ottosen?= Date: Fri, 30 Jul 2004 20:52:50 +0000 Subject: [PATCH] *** empty log message *** [SVN r24192] --- test/algorithm_example.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/algorithm_example.cpp b/test/algorithm_example.cpp index 5ca2e10..9ec315d 100755 --- a/test/algorithm_example.cpp +++ b/test/algorithm_example.cpp @@ -41,11 +41,11 @@ namespace // // replace first value and return its index // - template< typename ER, typename T > - inline typename boost::size_type_of< ER >::type - my_generic_replace( ER& c, const T& value, const T& replacement ) + template< class XRange, class T > + inline typename boost::size_type_of< XRange >::type + my_generic_replace( XRange& c, const T& value, const T& replacement ) { - typename boost::iterator_of::type found = find( c, value ); + typename boost::iterator_of::type found = find( c, value ); if( found != boost::end( c ) ) *found = replacement; @@ -63,7 +63,8 @@ int main() typedef std::vector::iterator iterator; std::pair my_view( boost::begin( my_vector ), boost::begin( my_vector ) + N ); - char str[] = "a string"; + char str_val[] = "a string"; + char* str = str_val; std::cout << my_generic_replace( my_vector, 4, 2 ) << my_generic_replace( my_view, 4, 2 )