{"action":"created","issue":{"url":"https://api.github.com/repos/dlang/phobos/issues/4828","repository_url":"https://api.github.com/repos/dlang/phobos","labels_url":"https://api.github.com/repos/dlang/phobos/issues/4828/labels{/name}","comments_url":"https://api.github.com/repos/dlang/phobos/issues/4828/comments","events_url":"https://api.github.com/repos/dlang/phobos/issues/4828/events","html_url":"https://github.com/dlang/phobos/pull/4828","id":180434896,"number":4828,"title":"Made isIterable no longer evaluate true for tuples","user":{"login":"pineapplemachine","id":7266412,"avatar_url":"https://avatars.githubusercontent.com/u/7266412?v=3","gravatar_id":"","url":"https://api.github.com/users/pineapplemachine","html_url":"https://github.com/pineapplemachine","followers_url":"https://api.github.com/users/pineapplemachine/followers","following_url":"https://api.github.com/users/pineapplemachine/following{/other_user}","gists_url":"https://api.github.com/users/pineapplemachine/gists{/gist_id}","starred_url":"https://api.github.com/users/pineapplemachine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pineapplemachine/subscriptions","organizations_url":"https://api.github.com/users/pineapplemachine/orgs","repos_url":"https://api.github.com/users/pineapplemachine/repos","events_url":"https://api.github.com/users/pineapplemachine/events{/privacy}","received_events_url":"https://api.github.com/users/pineapplemachine/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-10-01T03:16:16Z","updated_at":"2016-10-26T08:06:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dlang/phobos/pulls/4828","html_url":"https://github.com/dlang/phobos/pull/4828","diff_url":"https://github.com/dlang/phobos/pull/4828.diff","patch_url":"https://github.com/dlang/phobos/pull/4828.patch"},"body":"Discussed this with @UplinkCoder and concluded this might be a desirable change.\r\n\r\nWith this PR the `isIterable` template no longer evaluates true for tuple inputs, because though tuples are iterated over using the same `foreach` syntax the behavior is of course very different. The documentation seemed to suggest that it was never intended that the template behave this way, and its usage in Phobos seems to imply that it was expected to guarantee some constraints that do not apply to tuple inputs.\r\n\r\nFor example:\r\n\r\n``` D\r\nunittest{\r\n    auto input = Tuple!(int, string)(0, \"\");\r\n    static assert(isIterable!(typeof(input)));\r\n    auto x = input.reduce!((acc, next) => (acc + next)); // gross compile error\r\n    auto y = tuple().reduce!((acc, next) => (acc + next)); // even more gross\r\n}\r\n```\r\n\r\nThis PR causes the above gross compile errors to instead be reported as somewhat saner \"cannot deduce function from argument type\" errors.\r\n\r\nThe old `isIterable` template has been renamed to `isAnyIterable` should for some reason the old functionality be desired.\r\n\r\nWhile I was at it, I also added analogous `isIterableReverse` and `isAnyIterableReverse` templates and bolstered the unittests for all the changed and added templates."},"comment":{"url":"https://api.github.com/repos/dlang/phobos/issues/comments/256277710","html_url":"https://github.com/dlang/phobos/pull/4828#issuecomment-256277710","issue_url":"https://api.github.com/repos/dlang/phobos/issues/4828","id":256277710,"user":{"login":"JackStouffer","id":680068,"avatar_url":"https://avatars.githubusercontent.com/u/680068?v=3","gravatar_id":"","url":"https://api.github.com/users/JackStouffer","html_url":"https://github.com/JackStouffer","followers_url":"https://api.github.com/users/JackStouffer/followers","following_url":"https://api.github.com/users/JackStouffer/following{/other_user}","gists_url":"https://api.github.com/users/JackStouffer/gists{/gist_id}","starred_url":"https://api.github.com/users/JackStouffer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JackStouffer/subscriptions","organizations_url":"https://api.github.com/users/JackStouffer/orgs","repos_url":"https://api.github.com/users/JackStouffer/repos","events_url":"https://api.github.com/users/JackStouffer/events{/privacy}","received_events_url":"https://api.github.com/users/JackStouffer/received_events","type":"User","site_admin":false},"created_at":"2016-10-26T08:06:06Z","updated_at":"2016-10-26T08:06:06Z","body":"Ping @pineapplemachine "}}
{"actor":{"display_login":"JackStouffer"}}