Boost logo

Boost Users :

Subject: Re: [Boost-users] [filesystem] boost::filesystem::path::append() with boost::filesystem::iterator
From: Sebastian Karlsson (sairony_at_[hidden])
Date: 2011-12-09 12:54:50


2011/12/8 Sebastian Karlsson <sairony_at_[hidden]>

> Unexpectedly this does not seem to work. Consider:
>
> boost::filesystem::path a("foo/bar/"), b("root/test");
> a.append( b.begin() + 1, boost::filesystem::const_iterator() ); \\ Expects
> a == "foo/bar/test"
>
> Am I missing something?
>
> Kind regards,
> Sebastian Karlsson
>

Default constructed boost::filesystem::path::[const_]iterator is not a
valid end iterator as with boost::filesystem::directory_iterator it would
seem, barring that, here's the trac ticket with an make_relative() function
for which this functionality was originally needed for:
https://svn.boost.org/trac/boost/ticket/6249

Kind regards,
Sebastian Karlsson



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