D96986 refactors this bit entirely though.
Sure, assuming it passes tests.
However, eyeballing the uses of this thing, I got to directory_iterator.cpp, which does
err.report(m_ec, "at root \"%s\"", root);
That produces garbage on Windows, right? because root is a path and the way we unwrap(path const&) is to turn it into a wchar_t*, not a char*?