GitHub PullRequestReviewCommentEvent at 2014-05-08 02:34:38
Repository: spirit
Actor: K-ballo
Payload: {"comment":{"url":"https://api.github.com/repos/boostorg/spirit/pulls/comments/12413507","id":12413507,"diff_hunk":"@@ -0,0 +1,130 @@\n+/*=============================================================================\n+    Copyright (c) 2001-2011 Joel de Guzman\n+    Copyright (c) 2001-2011 Hartmut Kaiser\n+    Copyright (c) 2014 Thomas Bernard\n+\n+    Distributed under the Boost Software License, Version 1.0. (See accompanying\n+    file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\n+==============================================================================*/\n+#if !defined(SPIRIT_X3_REPEAT_APRIL_16_2014_0848AM)\n+#define SPIRIT_X3_REPEAT_APRIL_16_2014_0848AM\n+\n+#if defined(_MSC_VER)\n+#pragma once\n+#endif\n+\n+#include <boost/spirit/home/x3/core/parser.hpp>\n+#include <boost/spirit/home/x3/operator/kleene.hpp>\n+\n+namespace boost { namespace spirit { namespace x3\n+{\n+    template<typename Subject, typename RepeatIterator>\n+    struct repeat_directive : unary_parser<Subject, repeat_directive<Subject,RepeatIterator>>\n+    {\n+        typedef unary_parser<Subject, repeat_directive<Subject,RepeatIterator>> base_type;\n+        typedef std::function<bool(RepeatIterator const)> range_check_function;\n+        static bool const is_pass_through_unary = true;\n+        static bool const handles_container = true;\n+\n+        repeat_directive(Subject const& subject, range_check_function min_check, range_check_function max_check) :\n+            base_type(subject),\n+            got_min(min_check),\n+            got_max(max_check)\n+            {}\n+\n+        template <typename Iterator, typename Context, typename Attribute>\n+        bool parse(Iterator& first, Iterator const& last\n+          , Context const& context, Attribute& attr) const\n+        {\n+\n+            RepeatIterator i{};\n+            for (/**/; !got_min(i); ++i)\n+            {\n+                if (!detail::parse_into_container(\n+                      this->subject, first, last, context, attr))\n+                   return false;\n+            }\n+\n+            // parse some more up to the maximum specified\n+            Iterator save = first;\n+            for (/**/; !got_max(i); ++i)\n+            {\n+                if (!detail::parse_into_container(\n+                      this->subject, first, last, context, attr))\n+                    break;\n+                save = first;\n+            }\n+\n+            first = save;\n+            return true;\n+        }\n+\n+        range_check_function got_min;","path":"include/boost/spirit/home/x3/extensions/repeat.hpp","position":62,"original_position":62,"commit_id":"642a70afb873f016977539b4d43f643776e49edc","original_commit_id":"642a70afb873f016977539b4d43f643776e49edc","user":{"login":"K-ballo","id":1700391,"avatar_url":"https://avatars.githubusercontent.com/u/1700391?","gravatar_id":"7e14cf6e5335ed666725ce5321fca619","url":"https://api.github.com/users/K-ballo","html_url":"https://github.com/K-ballo","followers_url":"https://api.github.com/users/K-ballo/followers","following_url":"https://api.github.com/users/K-ballo/following{/other_user}","gists_url":"https://api.github.com/users/K-ballo/gists{/gist_id}","starred_url":"https://api.github.com/users/K-ballo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/K-ballo/subscriptions","organizations_url":"https://api.github.com/users/K-ballo/orgs","repos_url":"https://api.github.com/users/K-ballo/repos","events_url":"https://api.github.com/users/K-ballo/events{/privacy}","received_events_url":"https://api.github.com/users/K-ballo/received_events","type":"User","site_admin":false},"body":"The benefit I was talking about is that of having `friend` declarations document the coupling between otherwise seemingly independent classes, so that one can be aware that changing an implementation detail may ripple.","created_at":"2014-05-08T02:34:38Z","updated_at":"2014-05-08T02:34:38Z","html_url":"https://github.com/boostorg/spirit/pull/28#discussion_r12413507","pull_request_url":"https://api.github.com/repos/boostorg/spirit/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/boostorg/spirit/pulls/comments/12413507"},"html":{"href":"https://github.com/boostorg/spirit/pull/28#discussion_r12413507"},"pull_request":{"href":"https://api.github.com/repos/boostorg/spirit/pulls/28"}}}}