{"action":"created","issue":{"url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/1229","repository_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines","labels_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/1229/labels{/name}","comments_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/1229/comments","events_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/1229/events","html_url":"https://github.com/isocpp/CppCoreGuidelines/issues/1229","id":331128018,"node_id":"MDU6SXNzdWUzMzExMjgwMTg=","number":1229,"title":"ES.107: Signed subscripts for containers?!","user":{"login":"imre-palik","id":17094428,"node_id":"MDQ6VXNlcjE3MDk0NDI4","avatar_url":"https://avatars0.githubusercontent.com/u/17094428?v=4","gravatar_id":"","url":"https://api.github.com/users/imre-palik","html_url":"https://github.com/imre-palik","followers_url":"https://api.github.com/users/imre-palik/followers","following_url":"https://api.github.com/users/imre-palik/following{/other_user}","gists_url":"https://api.github.com/users/imre-palik/gists{/gist_id}","starred_url":"https://api.github.com/users/imre-palik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imre-palik/subscriptions","organizations_url":"https://api.github.com/users/imre-palik/orgs","repos_url":"https://api.github.com/users/imre-palik/repos","events_url":"https://api.github.com/users/imre-palik/events{/privacy}","received_events_url":"https://api.github.com/users/imre-palik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2018-06-11T10:17:07Z","updated_at":"2018-06-12T15:47:13Z","closed_at":null,"author_association":"NONE","body":"If the \"proper\" way would be signed subscripts, then could somebody explain me what would be the semantic meaning of a negative subscript e.g., for a std::vector?\r\n\r\nBTW, I would find it a really bad surprise if the following code would fail for any container\r\n\r\n`for (auto i = vec.size() -1; i  < vec.size(); i -= 2)\r\n    cout << vec[i] << '\\n';`\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/comments/396638710","html_url":"https://github.com/isocpp/CppCoreGuidelines/issues/1229#issuecomment-396638710","issue_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/1229","id":396638710,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NjYzODcxMA==","user":{"login":"imre-palik","id":17094428,"node_id":"MDQ6VXNlcjE3MDk0NDI4","avatar_url":"https://avatars0.githubusercontent.com/u/17094428?v=4","gravatar_id":"","url":"https://api.github.com/users/imre-palik","html_url":"https://github.com/imre-palik","followers_url":"https://api.github.com/users/imre-palik/followers","following_url":"https://api.github.com/users/imre-palik/following{/other_user}","gists_url":"https://api.github.com/users/imre-palik/gists{/gist_id}","starred_url":"https://api.github.com/users/imre-palik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imre-palik/subscriptions","organizations_url":"https://api.github.com/users/imre-palik/orgs","repos_url":"https://api.github.com/users/imre-palik/repos","events_url":"https://api.github.com/users/imre-palik/events{/privacy}","received_events_url":"https://api.github.com/users/imre-palik/received_events","type":"User","site_admin":false},"created_at":"2018-06-12T15:47:13Z","updated_at":"2018-06-12T15:47:13Z","author_association":"NONE","body":"I didn't ignore it, but maybe I was not clear enough with my response.  (BTW, ad hominem is neither nice, nor polite)  So here is my position again:\r\n\r\nI don't think it is a good tradeoff to exchange something well and widely understood, like modular arithmetic to something weird, like possibility of negative indices.  Especially not if the negative values are simply undefined.\r\n\r\nFor the backward looping you will either need modular arithmetic and unsigned indices, or non modular arithmetic and signed indices.  So if you have unsigned indices, then modular arithmetic is desired there.  So, at least in this case, you want both properties."}}
{"actor":{"display_login":"imre-palik"}}