Repository navigation
Implement LWG-3070 - #923
Conversation
Stephan T. Lavavej (StephanTLavavej)
left a comment
There was a problem hiding this comment.
Thanks for implementing this LWG issue resolution and adding test coverage! Looks good to me. I have an optional suggestion.
|
trying to use bool _Relative_path_contains_root_name(const path& _Path) {
return _STD any_of(_Path.relative_path().begin(), _Path.relative_path().end(),
[] (const path& _File_name) { return !_Parse_root_name(_File_name.native()).empty(); });
}out put: or |
|
DailyShana That's because you are calling relative_path() more than once; each call is creating a temporary path. Ideally this shouldn't need to call relative_path at all; it should use the underlying parsing machinery to avoid separate memory allocations here. |
I see, I didn't notice the effect of calling relative_path(), and I tried using parsing machinery and found loop relative_path is more clear and simple but I didn't notice the memory allocations. |
|
Congratulations on your first contribution to the STL! |
fix #333