【发布时间】:2020-09-25 12:08:58
【问题描述】:
在这两种情况下是否有理由调用 lexically_normal:
std::filesystem::path filepath = someFuntionThatGetsAPath();
filepath = std::filesystem::canonical (filepath).lexically_normal ();
filepath = std::filesystem::weakly_canonical (filepath).lexically_normal ();
我在代码库中看到了这一点,但我不确定是否有必要。我假设规范和弱规范不会失败并已经返回规范化路径。
谢谢
【问题讨论】:
-
看起来是多余的,但实现有缺陷(并且受到标准变化的影响)
标签: c++ c++17 std-filesystem