[Boost-bugs] [Boost C++ Libraries] #6249: boost::filesystem::path::append should be specialized for boost::filesystem::path::iterator

Subject: [Boost-bugs] [Boost C++ Libraries] #6249: boost::filesystem::path::append should be specialized for boost::filesystem::path::iterator
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-12-09 17:49:29


#6249: boost::filesystem::path::append should be specialized for
boost::filesystem::path::iterator
-------------------------------+--------------------------------------------
 Reporter: sairony@… | Owner: bemandawes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: None
  Version: Boost 1.46.1 | Severity: Problem
 Keywords: append relative |
-------------------------------+--------------------------------------------
 Currently the following is a no go:

 boost::filesystem::path a("foo/bar"), b("test/korv");
 a.append( b.begin() + 1, b.end() ); // Expects a == "foo/bar/korv"

 This is because append() is strictly for iterators of string types it
 would seem. I suggest adding the following specialization ( or something
 along these lines ):

         template < >
         path& path::append< path::iterator >( path::iterator begin,
 path::iterator end, const codecvt_type& cvt)
         {
                 for( ; begin != end ; ++begin )
                         *this /= *begin;
                 return *this;
         }

 I've attached an example of make_relative which uses this functionality.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6249>
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:08 UTC