Re: [Boost-bugs] [Boost C++ Libraries] #4891: include config/user.hpp in filesystem/* headers

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4891: include config/user.hpp in filesystem/* headers
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-12-05 10:54:13


#4891: include config/user.hpp in filesystem/* headers
-------------------------------+--------------------------------------------
  Reporter: andysem | Owner: bemandawes
      Type: Feature Requests | Status: reopened
 Milestone: To Be Determined | Component: filesystem
   Version: Boost 1.45.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+--------------------------------------------
Changes (by andysem):

  * status: closed => reopened
  * resolution: fixed =>

Comment:

 No, it doesn't work, because headers directly beneath filesystem directory
 don't include config.hpp. Assuming I have #defined
 BOOST_FILESYSTEM_VERSION 2 in my user.hpp, compiling this code fails:

 {{{
 #include <boost/filesystem/path.hpp>

 template< typename T1, typename T2 >
 void with_path(boost::filesystem::basic_path< T1, T2 >)
 {
 }


 int main(int, char*[])
 {
     with_path(boost::filesystem::path());
     return 0;
 }
 }}}

 The error is as follows:

 {{{
 In file included from ./boost/config.hpp:26,
                  from ./boost/filesystem/v3/path.hpp:18,
                  from ./boost/filesystem/path.hpp:28,
                  from fs_test.cpp:1:
 ./boost/config/user.hpp:123: warning: "BOOST_FILESYSTEM_VERSION" redefined
 ./boost/filesystem/path.hpp:21: note: this is the location of the previous
 definition
 In file included from ./boost/filesystem/v3/path.hpp:24,
                  from ./boost/filesystem/path.hpp:28,
                  from fs_test.cpp:1:
 ./boost/filesystem/v3/config.hpp:16: error: #error Compiling Filesystem
 version 3 file with BOOST_FILESYSTEM_VERSION defined != 3
 fs_test.cpp:4: error: variable or field ‘with_path’ declared void
 fs_test.cpp:4: error: ‘basic_path’ is not a member of ‘boost::filesystem’
 fs_test.cpp:4: error: expected primary-expression before ‘,’ token
 fs_test.cpp:4: error: expected primary-expression before ‘>’ token
 fs_test.cpp:4: error: expected primary-expression before ‘)’ token
 fs_test.cpp: In function ‘int main(int, char**)’:
 fs_test.cpp:11: error: ‘with_path’ was not declared in this scope
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4891#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC