Boost logo

Boost :

Subject: [boost] [filesystem] copy_file compilation error
From: Rob Conde (rob.conde_at_[hidden])
Date: 2015-05-04 11:49:05


In boost 1.55 the following code compiled file on visual studio 2013 and g++ 4.4.7:

#include "boost/filesystem/operations.hpp"

void myFunc()
{
   using namespace boost::filesystem;

   copy_option opt(copy_option::overwrite_if_exists);

   copy_file(path("p1"),path("p2"),opt);
}

in boost 1.58 I get the following error on g++ 4.4.7 (Visual Studio 2013 continues to work):

test.cpp: In function 'void myFunc()':
test.cpp:9: error: no matching function for call to 'copy_file(boost::filesystem::path, boost::filesystem::path, boost::filesystem::copy_option&)'
boost/filesystem/operations.hpp:494: note: candidates are: void boost::filesystem::copy_file(const boost::filesystem::path&, const boost::filesystem::path&, boost::filesystem::copy_option::enum_type)
boost/filesystem/operations.hpp:500: note: void boost::filesystem::copy_file(const boost::filesystem::path&, const boost::filesystem::path&)
boost/filesystem/operations.hpp:505: note: void boost::filesystem::copy_file(const boost::filesystem::path&, const boost::filesystem::path&, boost::filesystem::copy_option::enum_type, boost::system::error_code&)
boost/filesystem/operations.hpp:511: note: void boost::filesystem::copy_file(const boost::filesystem::path&, const boost::filesystem::path&, boost::system::error_code&)

is this a bug in filesystem on gcc, a bug in gcc, a non-standard behavior in visual studio 2013, or an intended change?

Rob Conde


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk