GitHub PullRequestReviewCommentEvent at 2014-05-13 19:19:17
Repository: phobos
Actor: WalterBright
Payload: {"comment":{"url":"https://api.github.com/repos/D-Programming-Language/phobos/pulls/comments/12603042","id":12603042,"diff_hunk":"@@ -2665,3 +2665,688 @@ version(unittest)\n         C[] _str;\n     }\n }\n+\n+\n+/**\n+ * Inserted in place of invalid UTF sequences.\n+ *\n+ * References:\n+ *      $(LINK http://en.wikipedia.org/wiki/Replacement_character#Replacement_character)\n+ */\n+enum dchar replacementDchar = '\\uFFFD';\n+\n+/********************************************\n+ * Iterate a range of char, wchar, or dchars by code unit.\n+ *\n+ * The purpose is to bypass the special case decoding that\n+ * $(XREF array,front) does to character arrays.\n+ * Params:\n+ *      r = input range of characters, or array of characters\n+ * Returns:\n+ *      input range\n+ */\n+\n+auto byCodeUnit(R)(R r) if (isSomeString!R)\n+{\n+    /* Turn an array into an InputRange.\n+     */\n+    static struct ByCodeUnitImpl\n+    {\n+        @property bool empty() { return r.length == 0; }\n+        @property auto front() { return r[0]; }\n+        void popFront()        { r = r[1 .. $]; }\n+        auto opIndex(size_t index) const { return r[index]; }\n+        typeof(this) opSlice(size_t lower, size_t upper)\n+        {\n+            auto ret = this;\n+            ret.r = r[lower..upper];\n+            return ret;\n+        }","path":"std/utf.d","position":40,"original_position":40,"commit_id":"06145a244c8ee1c1177943e38d5a739270c28ea5","original_commit_id":"06145a244c8ee1c1177943e38d5a739270c28ea5","user":{"login":"WalterBright","id":568298,"avatar_url":"https://avatars.githubusercontent.com/u/568298?","gravatar_id":"06f169620099a320c6d3d27aa78b6dfc","url":"https://api.github.com/users/WalterBright","html_url":"https://github.com/WalterBright","followers_url":"https://api.github.com/users/WalterBright/followers","following_url":"https://api.github.com/users/WalterBright/following{/other_user}","gists_url":"https://api.github.com/users/WalterBright/gists{/gist_id}","starred_url":"https://api.github.com/users/WalterBright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WalterBright/subscriptions","organizations_url":"https://api.github.com/users/WalterBright/orgs","repos_url":"https://api.github.com/users/WalterBright/repos","events_url":"https://api.github.com/users/WalterBright/events{/privacy}","received_events_url":"https://api.github.com/users/WalterBright/received_events","type":"User","site_admin":false},"body":"The inout causes further use of it to not compile.","created_at":"2014-05-13T19:19:17Z","updated_at":"2014-05-13T19:19:17Z","html_url":"https://github.com/D-Programming-Language/phobos/pull/2043#discussion_r12603042","pull_request_url":"https://api.github.com/repos/D-Programming-Language/phobos/pulls/2043","_links":{"self":{"href":"https://api.github.com/repos/D-Programming-Language/phobos/pulls/comments/12603042"},"html":{"href":"https://github.com/D-Programming-Language/phobos/pull/2043#discussion_r12603042"},"pull_request":{"href":"https://api.github.com/repos/D-Programming-Language/phobos/pulls/2043"}}}}