
7 Feb
2009
7 Feb
'09
11:17 p.m.
Andrey Semashev wrote:
Emil Dotchevski wrote:
const boost::filesystem::path path("dir1/./dir2/./dir3"); rob_path rpath; std::remove_copy(path.begin(), path.end(), std::back_inserter(rpath), ".");
Arguably the problem here isn't with basic_path, but with std::back_inserter, which insists on push_back being a member function. You could write your own path_inserter or something.
Can't we use lambda for this?
path rpath; std::remove_copy(path.begin(), path.end(), var(rpath) /= _1, ".");
Oh, I meant something like this: for_each(path.begin(), path.end(), if_(_1 != ".") [var(rpath) /= _1]);