Boost logo

Boost Users :

Subject: [Boost-users] BOOST_SYSTEM_NO_DEPRECATED and boost/filesystem/convenience.hpp
From: Paul (elegant_dice_at_[hidden])
Date: 2009-09-25 04:19:39


Hi,

If i compile with -DBOOST_SYSTEM_NO_DEPRECATED
and #include <boost/filesystem/convenience.hpp>

The compile will fail with the message:
boost/filesystem/convenience.hpp: In function ‘typename
boost::enable_if<boost::filesystem::is_basic_path<Path>, bool>::type
boost::filesystem::create_directories(const Path&)’:
boost/filesystem/convenience.hpp:48: error: ‘posix’ is not a member of
‘boost::system’

    BOOST_FS_FUNC(bool) create_directories(const Path& ph)
    {
         if (ph.empty() || exists(ph))
         {
           if ( !ph.empty() && !is_directory(ph) )
               boost::throw_exception( basic_filesystem_error<Path>(
                 "boost::filesystem::create_directories", ph,
                 make_error_code( boost::system::posix::file_exists ) ) );
           return false;
         }

The line with boost::system::posix::file_exists is the key problem.

In boost/system/error_code.hpp, posix is defined as a namespace

# ifndef BOOST_SYSTEM_NO_DEPRECATED
    namespace posix = errc;
    namespace posix_error = errc;
# endif

but ONLY if I don't define NO_DEPRECATED...

Maybe time for regression tests with BOOST_SYSTEM_NO_DEPRECATED defined?

thanks,
Paul


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net