https://bugs.llvm.org/show_bug.cgi?id=38504
Bug ID: 38504
Summary: std::filesystem::path::iterator::iterator_category is
non-comformingly "bidirectional_iterator_tag"
Product: libc++
Version: 7.0
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: All Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: ca...@carter.net
CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com
std::filesystem::path::iterator's member iterator_category is an alias for
bidirectional_iterator_tag, despite that it does not satisfy the requirement in
[forward.iterators]/6:
If a and b are both dereferenceable, then a == b if and only if *a and *b
are bound to the same object.
An iterator cannot be bidirectional if it is not forward, so the
iterator_category should in fact be input_iterator_tag, or - as a conforming
extension - some other type which is convertible to input_iterator_tag but not
convertible to forward_iterator_tag.
Note that if path::iterator::operator* were to return a prvalue it would
conform to the BidirectionalIterator concept in the Ranges proposal, and could
conformingly define its member iterator_concept as an alias for
std::bidirectional_iterator_tag.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs