Boost C++ Libraries: Ticket #6249: boost::filesystem::path::append should be specialized for boost::filesystem::path::iterator https://svn.boost.org/trac10/ticket/6249 <p> Currently the following is a no go: </p> <p> boost::filesystem::path a("foo/bar"), b("test/korv"); a.append( b.begin() + 1, b.end() ); <em> Expects a == "foo/bar/korv" </em></p> <p> 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 ): </p> <blockquote> <p> template &lt; &gt; path&amp; path::append&lt; path::iterator &gt;( path::iterator begin, path::iterator end, const codecvt_type&amp; cvt) { </p> <blockquote> <p> for( ; begin != end ; ++begin ) </p> <blockquote> <p> *this /= *begin; </p> </blockquote> <p> return *this; </p> </blockquote> <p> } </p> </blockquote> <p> I've attached an example of make_relative which uses this functionality. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6249 Trac 1.4.3 sairony@… Fri, 09 Dec 2011 17:49:50 GMT attachment set https://svn.boost.org/trac10/ticket/6249 https://svn.boost.org/trac10/ticket/6249 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">make_relative_append_example.cpp</span> </li> </ul> Ticket viboes Mon, 12 Dec 2011 22:36:10 GMT component changed https://svn.boost.org/trac10/ticket/6249#comment:1 https://svn.boost.org/trac10/ticket/6249#comment:1 <ul> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">filesystem</span> </li> </ul> Ticket Beman Dawes Sat, 05 Sep 2015 18:28:21 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/6249#comment:2 https://svn.boost.org/trac10/ticket/6249#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.60.0</span> </li> </ul> <p> Boost 1.60.0 will add functions lexically_normal, lexically_relative, relative, and weakly_canonical. These are designed to provide the equivalent to functionality requested by this ticket. </p> <p> See <a class="ext-link" href="http://boostorg.github.io/filesystem/relative_proposal.html"><span class="icon">​</span>http://boostorg.github.io/filesystem/relative_proposal.html</a> for more information. It proposes additional lexical and operational proximate functions, but I have chosen not to include those now. They will be reconsidered once users get some field experience with the core functionality for computing relative paths. </p> <p> These function are available now on the <a class="ext-link" href="https://github.com/boostorg/filesystem"><span class="icon">​</span>https://github.com/boostorg/filesystem</a> develop branch, and will be merged to master as soon as sufficient regression tests have cycled. They will also be proposed for inclusion in the next version of the C++ committee's TS 18822, File System Technical Specification. </p> <p> Many thanks to Jamie Allsop for his help and perseverance, and to everyone else who made suggestions and comments. Jamie's paper is available at <a class="ext-link" href="https://github.com/ja11sop/std-filesystem-relative"><span class="icon">​</span>https://github.com/ja11sop/std-filesystem-relative</a> </p> <p> Thanks, </p> <p> --Beman </p> Ticket