Would there be a reason to call lexically_normal in either of these cases:
std::filesystem::path filepath = someFuntionThatGetsAPath();
filepath = std::filesystem::canonical (filepath).lexically_normal ();
filepath = std::filesystem::weakly_canonical (filepath).lexically_normal ();
I'm seeing this in a code base and I am not sure if it is necessary. I am assuming that canonical and weakly canonical doesn't fail and returns a normalized path already.
Thanks
From the reference for weakly_canonical:
... The resulting path is in normal form.
So there is no point in calling lexically_normal on the return value of this function.
However, for canonical, the resulting path is not necessarily in normal form, and so it makes sense to call lexically_normal on the result.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With