diff --git a/include/boost/filesystem/path.hpp b/include/boost/filesystem/path.hpp index 7fa3354..09e658d 100644 --- a/include/boost/filesystem/path.hpp +++ b/include/boost/filesystem/path.hpp @@ -231,17 +231,21 @@ namespace boost basic_path() {} basic_path( const string_type & s, path_format_t = portable ) { operator/=( s ); } basic_path( const value_type * s, path_format_t = portable ) { operator/=( s ); } - template - basic_path( InputIterator first, InputIterator last, - path_format_t fmt=portable ) { append( first, last, fmt ); } +# ifndef BOOST_NO_MEMBER_TEMPLATES + template + basic_path( InputIterator first, InputIterator last, + path_format_t fmt=portable ) { append( first, last, fmt ); } +# endif ~basic_path() {} // assignments - basic_path & operator=( const string_type & s ) { m_path.clear(); operator/=( s ); return *this; } - basic_path & operator=( const value_type * s ) { m_path.clear(); operator/=( s ); return *this; } - template - basic_path & assign( InputIterator first, InputIterator last, - path_format_t fmt = portable ) { m_path.clear(); append( first, last, fmt ); return *this; } + basic_path & operator=( const string_type & s ) { m_path=""; operator/=( s ); return *this; } + basic_path & operator=( const value_type * s ) { m_path=""; operator/=( s ); return *this; } +# ifndef BOOST_NO_MEMBER_TEMPLATES + template + basic_path & assign( InputIterator first, InputIterator last, + path_format_t fmt = portable ) { m_path.clear(); append( first, last, fmt ); return *this; } +# endif // comparisons // overloads for string_type and value_type* are not provided because @@ -259,8 +263,10 @@ namespace boost basic_path & operator/=( const basic_path & rhs ) { return operator /=( rhs.string().c_str() ); } basic_path & operator/=( const string_type & rhs ) { return operator /=( rhs.c_str() ); } basic_path & operator/=( const value_type * s ); - template - basic_path & append( InputIterator first, InputIterator last, path_format_t fmt=portable ); +# ifndef BOOST_NO_MEMBER_TEMPLATES + template + basic_path & append( InputIterator first, InputIterator last, path_format_t fmt=portable ); +# endif basic_path & remove_leaf(); @@ -292,9 +298,11 @@ namespace boost basic_path operator/( const basic_path & rhs ) const { return basic_path( *this ) /= rhs; } basic_path operator/( const string_type & rhs ) const { return basic_path( *this ) /= rhs; } basic_path operator/( const value_type * rhs ) const { return basic_path( *this ) /= rhs; } - template - basic_path concat( InputIterator first, InputIterator last, - path_format_t fmt=portable) { return basic_path( *this ).append( first, last, fmt ); } +# ifndef BOOST_NO_MEMBER_TEMPLATES + template + basic_path concat( InputIterator first, InputIterator last, + path_format_t fmt=portable) { return basic_path( *this ).append( first, last, fmt ); } +# endif // iterators class iterator : public boost::iterator_facade< @@ -748,6 +756,7 @@ namespace boost return *this; } +# ifndef BOOST_NO_MEMBER_TEMPLATES template template basic_path & basic_path::append( InputIterator first, InputIterator last, path_format_t ) @@ -758,7 +767,7 @@ namespace boost for ( ; first != last; ++first ) m_append( *first ); return *this; } - +# endif /* // canonize ------------------------------------------------------------// diff --git a/test/operations_test.cpp b/test/operations_test.cpp index 31579fc..4acfefb 100644 --- a/test/operations_test.cpp +++ b/test/operations_test.cpp @@ -223,9 +223,10 @@ int test_main( int argc, char * argv[] ) BOOST_CHECK( sizeof( boost::uintmax_t ) >= 8 ); BOOST_CHECK( fs::space( dir ).available > 1000 ); // reasonable assumption BOOST_CHECK( fs::space( dir ).total > 1000000 ); // reasonable assumption - std::cout << "space().available = " << fs::space( dir ).available << '\n'; - std::cout << "space().total = " << fs::space( dir ).total << '\n'; - +# if !defined(BOOST_MSVC) || _MSC_VER >= 1300 // 1300 == VC++ 7.0 + std::cout << "space().available = " << fs::space( dir ).available << '\n'; + std::cout << "space().total = " << fs::space( dir ).total << '\n'; +# endif BOOST_CHECK( fs::exists( dir ) ); BOOST_CHECK( BOOST_FS_IS_EMPTY( dir ) ); BOOST_CHECK( fs::is_directory( dir ) ); diff --git a/test/path_test.cpp b/test/path_test.cpp index 47515fd..de9f1f3 100644 --- a/test/path_test.cpp +++ b/test/path_test.cpp @@ -232,8 +232,10 @@ int test_main( int, char*[] ) p4 /= path( "foo" ); p4 /= "foo"; p4 /= std::string( "foo" ); - + +# ifndef BOOST_NO_MEMBER_TEMPLATES BOOST_CHECK( p4.string() == path( p4.string().begin(), p4.string().end() ).string() ); +# endif BOOST_CHECK( p1 != p4 ); BOOST_CHECK( p1.string() == p2.string() ); BOOST_CHECK( p1.string() == p3.string() );