[llvm-bugs] [Bug 38504] New: std::filesystem::path::iterator::iterator_category is non-comformingly "bidirectional_iterator_tag"
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Aug 9 08:05:22 PDT 2018
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: unassignedclangbugs at nondot.org
Reporter: Casey at Carter.net
CC: llvm-bugs at lists.llvm.org, mclow.lists at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180809/e0611362/attachment.html>
More information about the llvm-bugs
mailing list