The documentation boost::filesystem::path::lexically_normal()
reads:
Returns *this
with the current directory (point) deleted, the parent directory (point-to-point), and directory separator elements removed.
See http://www.boost.org/doc/libs/1_63_0/libs/filesystem/doc/reference.html .
The following prints ./test
(using Boost 1.63.0), where I expected test
:
#include <boost/filesystem/path.hpp>
#include <iostream>
int main(void)
{
std::cout << boost::filesystem::path{"./test"}.lexically_normal().string() << "\n";
return 0;
}
Thus, the first point element is not considered redundant. Nevertheless, as test
it is ./test
obvious, they allow the same file when using the boost file system, so it seems contradictory to me. Is this expected behavior?
: ++ 17 "test"
(GCC 8.2.0, Linux).