I have a certain boost::filesystem::path in hand and I’d like to append a string (or path) to it.
boost::filesystem::path p("c:\\dir");
p.append(".foo"); // should result in p pointing to c:\dir.foo
The only overload boost::filesystem::path has of append wants two InputIterators.
My solution so far is to do the following:
boost::filesystem::path p2(std::string(p.string()).append(".foo"));
Am I missing something?
Tested with 1.37, but leaf and remove_leaf are also documented in 1.35. You’ll need to test whether the last component of p is a filename first, if it might not be.