Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52764 - in sandbox/boost0x: boost/filesystem libs/filesystem/test
From: kim_at_[hidden]
Date: 2009-05-04 22:27:33


Author: kimscheibel
Date: 2009-05-04 22:27:32 EDT (Mon, 04 May 2009)
New Revision: 52764
URL: http://svn.boost.org/trac/boost/changeset/52764

Log:
turns out we do have swap() already, let's use it
Text files modified:
   sandbox/boost0x/boost/filesystem/path.hpp | 3 +--
   sandbox/boost0x/libs/filesystem/test/path_test.cpp | 1 +
   2 files changed, 2 insertions(+), 2 deletions(-)

Modified: sandbox/boost0x/boost/filesystem/path.hpp
==============================================================================
--- sandbox/boost0x/boost/filesystem/path.hpp (original)
+++ sandbox/boost0x/boost/filesystem/path.hpp 2009-05-04 22:27:32 EDT (Mon, 04 May 2009)
@@ -30,7 +30,6 @@
 #include <iosfwd> // needed by basic_path inserter and extractor
 #include <stdexcept>
 #include <cassert>
-#include <iostream>
 
 # ifndef BOOST_FILESYSTEM_NARROW_ONLY
 # include <locale>
@@ -165,7 +164,7 @@
       // constructors/destructor
       basic_path() {}
       basic_path( const path_type & p ) : m_path(p.m_path) {}
- basic_path( path_type && p ) { m_path.clear(); m_path.swap(p.m_path); std::cout << "moving\n"; } // TODO: which swap()
+ basic_path( path_type && p ) { this->swap(p); }
       basic_path( const string_type & s ) { operator/=( s ); }
       basic_path( const value_type * s ) { operator/=( s ); }
 # ifndef BOOST_NO_MEMBER_TEMPLATES

Modified: sandbox/boost0x/libs/filesystem/test/path_test.cpp
==============================================================================
--- sandbox/boost0x/libs/filesystem/test/path_test.cpp (original)
+++ sandbox/boost0x/libs/filesystem/test/path_test.cpp 2009-05-04 22:27:32 EDT (Mon, 04 May 2009)
@@ -205,6 +205,7 @@
 
   path p1_move( "fe/fi/fo/fum" );
   path p2_move( std::move(p1_move) );
+ BOOST_TEST( p2_move.string() == "fe/fi/fo/fum" );
 
   path p3;
   BOOST_TEST( p1.string() != p3.string() );


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk