Issue 55521
Summary libcxx: `path::iterator` has wrong category
Labels new issue
Assignees
Reporter Imre-Palik-Firebolt
    According to https://en.cppreference.com/w/cpp/filesystem/path , `path::iterator` should fulfil the concept of _LegacyBidirectionalIterator_.  But it is tagger as `typedef input_iterator_tag iterator_category;`
This makes it impossible to call `std::prev()` on `path::iterator`, as `prev()` has the following check:
`_LIBCPP_ASSERT(__n <= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
                 "Attempt to prev(it, n) with a positive n on a non-bidirectional iterator");`

Changing the `typedef` in `path::iterator` to `typedef bidirectional_iterator_tag iterator_category;`, makes `std::prev()` great again.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to