{"action":"created","issue":{"url":"https://api.github.com/repos/ericniebler/stl2/issues/156","repository_url":"https://api.github.com/repos/ericniebler/stl2","labels_url":"https://api.github.com/repos/ericniebler/stl2/issues/156/labels{/name}","comments_url":"https://api.github.com/repos/ericniebler/stl2/issues/156/comments","events_url":"https://api.github.com/repos/ericniebler/stl2/issues/156/events","html_url":"https://github.com/ericniebler/stl2/issues/156","id":118318278,"number":156,"title":"\"Stashing\" iterators","user":{"login":"CaseyCarter","id":456873,"avatar_url":"https://avatars.githubusercontent.com/u/456873?v=3","gravatar_id":"","url":"https://api.github.com/users/CaseyCarter","html_url":"https://github.com/CaseyCarter","followers_url":"https://api.github.com/users/CaseyCarter/followers","following_url":"https://api.github.com/users/CaseyCarter/following{/other_user}","gists_url":"https://api.github.com/users/CaseyCarter/gists{/gist_id}","starred_url":"https://api.github.com/users/CaseyCarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaseyCarter/subscriptions","organizations_url":"https://api.github.com/users/CaseyCarter/orgs","repos_url":"https://api.github.com/users/CaseyCarter/repos","events_url":"https://api.github.com/users/CaseyCarter/events{/privacy}","received_events_url":"https://api.github.com/users/CaseyCarter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2015-11-23T04:20:06Z","updated_at":"2016-10-28T19:16:56Z","closed_at":null,"body":"Iterators that return a reference to a member object are known as \"stashing\" iterators - `istream_iterator` is the classic example. They famously do not work with `reverse_iterator`, since they violate [forward.iterators]/6:\r\n> If `a` and `b` are both dereferenceable, then `a == b` if and only if `*a` and `*b` are bound to the same object.\r\n\r\n3efd5da3271a6778ce54aaa0f766d4191455dec4 \"various concept tweaks\" committed June 1 changed this requirement in the TS to:\r\n```tex\r\nIf \\tcode{a} and \\tcode{b} are both dereferenceable, then \\tcode{a == b} if and only if\r\n\\tcode{*a} is equal to \\tcode{*b}.\r\n```\r\nSo that the requirement has well-defined meaning when `*a` and `*b` are not objects. \r\n\r\n5578feee5e6538055e66d42e24afe559be930aa0 \"Language for equality-preserving-by-default expressions\" committed July 3 removed the requirement completely, since\r\n* `*a == *b` if `a == b` is implied by the equality preservation of `*` from `Readable`, and\r\n* `a == b` if `*a == *b` requires that a value appears at most once in any given range, which was not intended.\r\n\r\nI believe the TS wording now allows \"stashing\" iterators to satisfy `Forward`, despite that many reasonable operations simply don't work with them. Iterators *denote* elements, they must not *own* them: the expectation is that the lifetime of denoted object elements is the lifetime of the range, *not* the lifetime of the iterator. We need to bring back a requirement that forbids \"stashing\" `Forward` iterators. This should cause no hardship to TS users since `Forward` iterators can have prvalue types.\r\n\r\nProxy reference types make it challenging to develop a simple requirement; the straightforward \"If `reference_t<I>` is a reference type, then `&*a == &*b` iff `a == b`\" doesn't work. The high-level wording \"If iterator values denote objects, then `a == b` iff `a` and `b` denote the same object.\" seems clearer to me, but I'm accustomed to thinking of iterators as either denoting objects or denoting values. I'm not sure someone coming straight to the TS from C++14 would understand. I also don't think the \"If..dereferenceable\" qualifier since (a) past-the-end iterators denote the same past-the-end object, and  (b) singular iterators won't be in the domain of `==` and can therefor do anything they like."},"comment":{"url":"https://api.github.com/repos/ericniebler/stl2/issues/comments/257005175","html_url":"https://github.com/ericniebler/stl2/issues/156#issuecomment-257005175","issue_url":"https://api.github.com/repos/ericniebler/stl2/issues/156","id":257005175,"user":{"login":"ericniebler","id":225757,"avatar_url":"https://avatars.githubusercontent.com/u/225757?v=3","gravatar_id":"","url":"https://api.github.com/users/ericniebler","html_url":"https://github.com/ericniebler","followers_url":"https://api.github.com/users/ericniebler/followers","following_url":"https://api.github.com/users/ericniebler/following{/other_user}","gists_url":"https://api.github.com/users/ericniebler/gists{/gist_id}","starred_url":"https://api.github.com/users/ericniebler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericniebler/subscriptions","organizations_url":"https://api.github.com/users/ericniebler/orgs","repos_url":"https://api.github.com/users/ericniebler/repos","events_url":"https://api.github.com/users/ericniebler/events{/privacy}","received_events_url":"https://api.github.com/users/ericniebler/received_events","type":"User","site_admin":false},"created_at":"2016-10-28T19:16:56Z","updated_at":"2016-10-28T19:16:56Z","body":"Should be resolved together with #226, which also needs a characterization of proxy references. "}}
{"actor":{"display_login":"ericniebler"}}