{"action":"created","issue":{"url":"https://api.github.com/repos/boostorg/iterator/issues/47","repository_url":"https://api.github.com/repos/boostorg/iterator","labels_url":"https://api.github.com/repos/boostorg/iterator/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/boostorg/iterator/issues/47/comments","events_url":"https://api.github.com/repos/boostorg/iterator/issues/47/events","html_url":"https://github.com/boostorg/iterator/issues/47","id":384123010,"node_id":"MDU6SXNzdWUzODQxMjMwMTA=","number":47,"title":"bidirectional_traversal_tag not work with std::prev","user":{"login":"tower120","id":2050822,"node_id":"MDQ6VXNlcjIwNTA4MjI=","avatar_url":"https://avatars1.githubusercontent.com/u/2050822?v=4","gravatar_id":"","url":"https://api.github.com/users/tower120","html_url":"https://github.com/tower120","followers_url":"https://api.github.com/users/tower120/followers","following_url":"https://api.github.com/users/tower120/following{/other_user}","gists_url":"https://api.github.com/users/tower120/gists{/gist_id}","starred_url":"https://api.github.com/users/tower120/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tower120/subscriptions","organizations_url":"https://api.github.com/users/tower120/orgs","repos_url":"https://api.github.com/users/tower120/repos","events_url":"https://api.github.com/users/tower120/events{/privacy}","received_events_url":"https://api.github.com/users/tower120/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-11-25T21:54:04Z","updated_at":"2018-12-01T10:08:07Z","closed_at":null,"author_association":"NONE","body":"In the following code `bidirectional_traversal_tag` does not work with `std::prev`. Iterator does not recognized as bidirirectional.\r\n\r\n```cpp\r\n#include <iostream>\r\n#include <boost/iterator/iterator_facade.hpp>\r\n\r\nclass node_iterator\r\n\t: public boost::iterator_facade\r\n\t  <\r\n\t\tnode_iterator\r\n\t\t, std::pair<int, int>\r\n\t\t, boost::bidirectional_traversal_tag\r\n\t\t, std::pair<int, int>\r\n\t  >\r\n{\r\npublic:\r\n\tnode_iterator()\r\n\t\t: m_i(0) {}\r\n\r\n\texplicit node_iterator(int i)\r\n\t\t: m_i(i) {}\r\n\r\nprivate:\r\n\tfriend class boost::iterator_core_access;\r\n\r\n\tvoid increment() { m_i++; }\r\n        void decrement() { m_i--; }\r\n\r\n\tbool equal(node_iterator const& other) const\r\n\t{\r\n\t\treturn this->m_i == other.m_i;\r\n\t}\r\n\r\n\tstd::pair<int, int> dereference() const { return { m_i, m_i}; }\r\npublic:\r\n\tint m_i;\r\n};\r\n\r\n\r\nint main()\r\n{\r\n\tauto i1  = node_iterator(1);\r\n\tauto i10 = node_iterator(10);\r\n\r\n       std::next(i1);\r\n       std::prev(i1);\r\n\t\r\n\tstd::cout <<\"aaa\";\r\n}\r\n\r\n```\r\n\r\nOnline : [https://wandbox.org/permlink/T51UwajOX4Lf8aif](https://wandbox.org/permlink/T51UwajOX4Lf8aif)"},"comment":{"url":"https://api.github.com/repos/boostorg/iterator/issues/comments/443415153","html_url":"https://github.com/boostorg/iterator/issues/47#issuecomment-443415153","issue_url":"https://api.github.com/repos/boostorg/iterator/issues/47","id":443415153,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzQxNTE1Mw==","user":{"login":"Lastique","id":1589747,"node_id":"MDQ6VXNlcjE1ODk3NDc=","avatar_url":"https://avatars0.githubusercontent.com/u/1589747?v=4","gravatar_id":"","url":"https://api.github.com/users/Lastique","html_url":"https://github.com/Lastique","followers_url":"https://api.github.com/users/Lastique/followers","following_url":"https://api.github.com/users/Lastique/following{/other_user}","gists_url":"https://api.github.com/users/Lastique/gists{/gist_id}","starred_url":"https://api.github.com/users/Lastique/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lastique/subscriptions","organizations_url":"https://api.github.com/users/Lastique/orgs","repos_url":"https://api.github.com/users/Lastique/repos","events_url":"https://api.github.com/users/Lastique/events{/privacy}","received_events_url":"https://api.github.com/users/Lastique/received_events","type":"User","site_admin":false},"created_at":"2018-12-01T10:08:07Z","updated_at":"2018-12-01T10:08:07Z","author_association":"MEMBER","body":"The `reference` type by default is `value_type&`, so I suspect, `operator*()` should either fail to compile or you would get a dangling reference from it. (To compile this, the compiler would have to bind a non-const reference to rvalue, and I know some versions of MSVC allowed that; not sure if that's still the case.)\r\n"}}
{"actor":{"display_login":"Lastique"}}