[filesystem] copy_file compilation error
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
Hi,
is this a bug in filesystem on gcc, a bug in gcc, a non-standard behavior in visual studio 2013, or an intended change? This seems to be a problem with scoped_enum emulation. It works, if you use gcc in C++11-Mode (at least with 4.9.2) or directly pass the copy_option to the function.
Best regards, Stefan Floeren
Actually, I think the emulation is fine. You have to do:
BOOST_SCOPED_ENUM(copy_option) opt(copy_option::overwrite_if_exists);
and then it works as expected.
Rob
________________________________________
From: Boost
is this a bug in filesystem on gcc, a bug in gcc, a non-standard behavior in visual studio 2013, or an intended change? This seems to be a problem with scoped_enum emulation. It works, if you use gcc in C++11-Mode (at least with 4.9.2) or directly pass the copy_option to the function.
Best regards, Stefan Floeren _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Rob Conde
-
Stefan Floeren