{"action":"created","comment":{"url":"https://api.github.com/repos/simbody/simbody/pulls/comments/51370468","id":51370468,"diff_hunk":"@@ -0,0 +1,62 @@\n+#ifndef SimTK_SimTKCOMMON_ITERATOR_RANGE_H_\n+#define SimTK_SimTKCOMMON_ITERATOR_RANGE_H_\n+\n+/* -------------------------------------------------------------------------- *\n+ *                       Simbody(tm): SimTKcommon                             *\n+ * -------------------------------------------------------------------------- *\n+ * This is part of the SimTK biosimulation toolkit originating from           *\n+ * Simbios, the NIH National Center for Physics-Based Simulation of           *\n+ * Biological Structures at Stanford, funded under the NIH Roadmap for        *\n+ * Medical Research, grant U54 GM072970. See https://simtk.org/home/simbody.  *\n+ *                                                                            *\n+ * Portions copyright (c) 2008-16 Stanford University and the Authors.        *\n+ * Authors: Chris Dembia                                                      *\n+ * Contributors:                                                              *\n+ *                                                                            *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may    *\n+ * not use this file except in compliance with the License. You may obtain a  *\n+ * copy of the License at http://www.apache.org/licenses/LICENSE-2.0.         *\n+ *                                                                            *\n+ * Unless required by applicable law or agreed to in writing, software        *\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,          *\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   *\n+ * See the License for the specific language governing permissions and        *\n+ * limitations under the License.                                             *\n+ * -------------------------------------------------------------------------- */\n+\n+namespace SimTK {\n+\n+/** Helper class to use range-based for loops with a pair of iterators. This\n+ * class should only be used when you're sure the iterators are valid. Don't\n+ * use this class directly; instead, use makeIteratorRange().\n+ *\n+ * @code\n+ * for (auto& x : makeIteratorRange(v.begin(), v.end())) {\n+ *     ...\n+ * }\n+ * @endcode\n+ * */","path":"SimTKcommon/include/SimTKcommon/internal/IteratorRange.h","position":null,"original_position":38,"commit_id":"2734ae16dc919f344cb9edd4a431193dd5626ed3","original_commit_id":"fbc096bb226eb40a14fff91798e6db3757f26c2e","user":{"login":"chrisdembia","id":846001,"avatar_url":"https://avatars.githubusercontent.com/u/846001?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdembia","html_url":"https://github.com/chrisdembia","followers_url":"https://api.github.com/users/chrisdembia/followers","following_url":"https://api.github.com/users/chrisdembia/following{/other_user}","gists_url":"https://api.github.com/users/chrisdembia/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdembia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdembia/subscriptions","organizations_url":"https://api.github.com/users/chrisdembia/orgs","repos_url":"https://api.github.com/users/chrisdembia/repos","events_url":"https://api.github.com/users/chrisdembia/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdembia/received_events","type":"User","site_admin":false},"body":"Addressed. The use of initial `*`'s was an accident; I'm aware of your preference.","created_at":"2016-02-01T00:05:11Z","updated_at":"2016-02-01T00:05:11Z","html_url":"https://github.com/simbody/simbody/pull/467#discussion_r51370468","pull_request_url":"https://api.github.com/repos/simbody/simbody/pulls/467","_links":{"self":{"href":"https://api.github.com/repos/simbody/simbody/pulls/comments/51370468"},"html":{"href":"https://github.com/simbody/simbody/pull/467#discussion_r51370468"},"pull_request":{"href":"https://api.github.com/repos/simbody/simbody/pulls/467"}}},"pull_request":{"url":"https://api.github.com/repos/simbody/simbody/pulls/467","id":57685001,"html_url":"https://github.com/simbody/simbody/pull/467","diff_url":"https://github.com/simbody/simbody/pull/467.diff","patch_url":"https://github.com/simbody/simbody/pull/467.patch","issue_url":"https://api.github.com/repos/simbody/simbody/issues/467","number":467,"state":"open","locked":false,"title":"Iterator range","user":{"login":"chrisdembia","id":846001,"avatar_url":"https://avatars.githubusercontent.com/u/846001?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdembia","html_url":"https://github.com/chrisdembia","followers_url":"https://api.github.com/users/chrisdembia/followers","following_url":"https://api.github.com/users/chrisdembia/following{/other_user}","gists_url":"https://api.github.com/users/chrisdembia/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdembia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdembia/subscriptions","organizations_url":"https://api.github.com/users/chrisdembia/orgs","repos_url":"https://api.github.com/users/chrisdembia/repos","events_url":"https://api.github.com/users/chrisdembia/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdembia/received_events","type":"User","site_admin":false},"body":"This PR adds a helper class that allows using range-based for loops with a pair of iterators:\r\n\r\n```cpp\r\nstd::vector<int> v {5, 10, 15, 20};\r\nauto first = std::lower_bound(v.begin(), v.end(), 10);\r\nauto last = std::upper_bound(v.begin(), v.end(), 15);\r\nfor (auto& x : makeIteratorRange(first, last)) {\r\n    ...\r\n}\r\n```","created_at":"2016-01-29T18:35:40Z","updated_at":"2016-02-01T00:05:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d604fcdf13a4ae1cf95ec02dfa18535da39fd9e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/simbody/simbody/pulls/467/commits","review_comments_url":"https://api.github.com/repos/simbody/simbody/pulls/467/comments","review_comment_url":"https://api.github.com/repos/simbody/simbody/pulls/comments{/number}","comments_url":"https://api.github.com/repos/simbody/simbody/issues/467/comments","statuses_url":"https://api.github.com/repos/simbody/simbody/statuses/2734ae16dc919f344cb9edd4a431193dd5626ed3","head":{"label":"chrisdembia:iterator-range","ref":"iterator-range","sha":"2734ae16dc919f344cb9edd4a431193dd5626ed3","user":{"login":"chrisdembia","id":846001,"avatar_url":"https://avatars.githubusercontent.com/u/846001?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdembia","html_url":"https://github.com/chrisdembia","followers_url":"https://api.github.com/users/chrisdembia/followers","following_url":"https://api.github.com/users/chrisdembia/following{/other_user}","gists_url":"https://api.github.com/users/chrisdembia/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdembia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdembia/subscriptions","organizations_url":"https://api.github.com/users/chrisdembia/orgs","repos_url":"https://api.github.com/users/chrisdembia/repos","events_url":"https://api.github.com/users/chrisdembia/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdembia/received_events","type":"User","site_admin":false},"repo":{"id":12479956,"name":"simbody","full_name":"chrisdembia/simbody","owner":{"login":"chrisdembia","id":846001,"avatar_url":"https://avatars.githubusercontent.com/u/846001?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdembia","html_url":"https://github.com/chrisdembia","followers_url":"https://api.github.com/users/chrisdembia/followers","following_url":"https://api.github.com/users/chrisdembia/following{/other_user}","gists_url":"https://api.github.com/users/chrisdembia/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdembia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdembia/subscriptions","organizations_url":"https://api.github.com/users/chrisdembia/orgs","repos_url":"https://api.github.com/users/chrisdembia/repos","events_url":"https://api.github.com/users/chrisdembia/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdembia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chrisdembia/simbody","description":"Source code for the Simbody libraries, examples, and build system.","fork":true,"url":"https://api.github.com/repos/chrisdembia/simbody","forks_url":"https://api.github.com/repos/chrisdembia/simbody/forks","keys_url":"https://api.github.com/repos/chrisdembia/simbody/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chrisdembia/simbody/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chrisdembia/simbody/teams","hooks_url":"https://api.github.com/repos/chrisdembia/simbody/hooks","issue_events_url":"https://api.github.com/repos/chrisdembia/simbody/issues/events{/number}","events_url":"https://api.github.com/repos/chrisdembia/simbody/events","assignees_url":"https://api.github.com/repos/chrisdembia/simbody/assignees{/user}","branches_url":"https://api.github.com/repos/chrisdembia/simbody/branches{/branch}","tags_url":"https://api.github.com/repos/chrisdembia/simbody/tags","blobs_url":"https://api.github.com/repos/chrisdembia/simbody/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chrisdembia/simbody/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chrisdembia/simbody/git/refs{/sha}","trees_url":"https://api.github.com/repos/chrisdembia/simbody/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chrisdembia/simbody/statuses/{sha}","languages_url":"https://api.github.com/repos/chrisdembia/simbody/languages","stargazers_url":"https://api.github.com/repos/chrisdembia/simbody/stargazers","contributors_url":"https://api.github.com/repos/chrisdembia/simbody/contributors","subscribers_url":"https://api.github.com/repos/chrisdembia/simbody/subscribers","subscription_url":"https://api.github.com/repos/chrisdembia/simbody/subscription","commits_url":"https://api.github.com/repos/chrisdembia/simbody/commits{/sha}","git_commits_url":"https://api.github.com/repos/chrisdembia/simbody/git/commits{/sha}","comments_url":"https://api.github.com/repos/chrisdembia/simbody/comments{/number}","issue_comment_url":"https://api.github.com/repos/chrisdembia/simbody/issues/comments{/number}","contents_url":"https://api.github.com/repos/chrisdembia/simbody/contents/{+path}","compare_url":"https://api.github.com/repos/chrisdembia/simbody/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chrisdembia/simbody/merges","archive_url":"https://api.github.com/repos/chrisdembia/simbody/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chrisdembia/simbody/downloads","issues_url":"https://api.github.com/repos/chrisdembia/simbody/issues{/number}","pulls_url":"https://api.github.com/repos/chrisdembia/simbody/pulls{/number}","milestones_url":"https://api.github.com/repos/chrisdembia/simbody/milestones{/number}","notifications_url":"https://api.github.com/repos/chrisdembia/simbody/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chrisdembia/simbody/labels{/name}","releases_url":"https://api.github.com/repos/chrisdembia/simbody/releases{/id}","deployments_url":"https://api.github.com/repos/chrisdembia/simbody/deployments","created_at":"2013-08-30T06:46:15Z","updated_at":"2015-04-01T23:06:40Z","pushed_at":"2016-02-01T00:03:34Z","git_url":"git://github.com/chrisdembia/simbody.git","ssh_url":"git@github.com:chrisdembia/simbody.git","clone_url":"https://github.com/chrisdembia/simbody.git","svn_url":"https://github.com/chrisdembia/simbody","homepage":"https://simtk.org/home/simbody","size":203845,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"simbody:master","ref":"master","sha":"9dfbe4c07c45054c7eb51ec00e5163e3814947fc","user":{"login":"simbody","id":5199961,"avatar_url":"https://avatars.githubusercontent.com/u/5199961?v=3","gravatar_id":"","url":"https://api.github.com/users/simbody","html_url":"https://github.com/simbody","followers_url":"https://api.github.com/users/simbody/followers","following_url":"https://api.github.com/users/simbody/following{/other_user}","gists_url":"https://api.github.com/users/simbody/gists{/gist_id}","starred_url":"https://api.github.com/users/simbody/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simbody/subscriptions","organizations_url":"https://api.github.com/users/simbody/orgs","repos_url":"https://api.github.com/users/simbody/repos","events_url":"https://api.github.com/users/simbody/events{/privacy}","received_events_url":"https://api.github.com/users/simbody/received_events","type":"Organization","site_admin":false},"repo":{"id":12146969,"name":"simbody","full_name":"simbody/simbody","owner":{"login":"simbody","id":5199961,"avatar_url":"https://avatars.githubusercontent.com/u/5199961?v=3","gravatar_id":"","url":"https://api.github.com/users/simbody","html_url":"https://github.com/simbody","followers_url":"https://api.github.com/users/simbody/followers","following_url":"https://api.github.com/users/simbody/following{/other_user}","gists_url":"https://api.github.com/users/simbody/gists{/gist_id}","starred_url":"https://api.github.com/users/simbody/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simbody/subscriptions","organizations_url":"https://api.github.com/users/simbody/orgs","repos_url":"https://api.github.com/users/simbody/repos","events_url":"https://api.github.com/users/simbody/events{/privacy}","received_events_url":"https://api.github.com/users/simbody/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simbody/simbody","description":"High-performance C++ multibody dynamics/physics library for simulating articulated biomechanical and mechanical systems like vehicles, robots, and the human skeleton.","fork":false,"url":"https://api.github.com/repos/simbody/simbody","forks_url":"https://api.github.com/repos/simbody/simbody/forks","keys_url":"https://api.github.com/repos/simbody/simbody/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simbody/simbody/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simbody/simbody/teams","hooks_url":"https://api.github.com/repos/simbody/simbody/hooks","issue_events_url":"https://api.github.com/repos/simbody/simbody/issues/events{/number}","events_url":"https://api.github.com/repos/simbody/simbody/events","assignees_url":"https://api.github.com/repos/simbody/simbody/assignees{/user}","branches_url":"https://api.github.com/repos/simbody/simbody/branches{/branch}","tags_url":"https://api.github.com/repos/simbody/simbody/tags","blobs_url":"https://api.github.com/repos/simbody/simbody/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simbody/simbody/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simbody/simbody/git/refs{/sha}","trees_url":"https://api.github.com/repos/simbody/simbody/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simbody/simbody/statuses/{sha}","languages_url":"https://api.github.com/repos/simbody/simbody/languages","stargazers_url":"https://api.github.com/repos/simbody/simbody/stargazers","contributors_url":"https://api.github.com/repos/simbody/simbody/contributors","subscribers_url":"https://api.github.com/repos/simbody/simbody/subscribers","subscription_url":"https://api.github.com/repos/simbody/simbody/subscription","commits_url":"https://api.github.com/repos/simbody/simbody/commits{/sha}","git_commits_url":"https://api.github.com/repos/simbody/simbody/git/commits{/sha}","comments_url":"https://api.github.com/repos/simbody/simbody/comments{/number}","issue_comment_url":"https://api.github.com/repos/simbody/simbody/issues/comments{/number}","contents_url":"https://api.github.com/repos/simbody/simbody/contents/{+path}","compare_url":"https://api.github.com/repos/simbody/simbody/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simbody/simbody/merges","archive_url":"https://api.github.com/repos/simbody/simbody/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simbody/simbody/downloads","issues_url":"https://api.github.com/repos/simbody/simbody/issues{/number}","pulls_url":"https://api.github.com/repos/simbody/simbody/pulls{/number}","milestones_url":"https://api.github.com/repos/simbody/simbody/milestones{/number}","notifications_url":"https://api.github.com/repos/simbody/simbody/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simbody/simbody/labels{/name}","releases_url":"https://api.github.com/repos/simbody/simbody/releases{/id}","deployments_url":"https://api.github.com/repos/simbody/simbody/deployments","created_at":"2013-08-16T00:21:53Z","updated_at":"2016-01-27T23:29:10Z","pushed_at":"2016-02-01T00:03:35Z","git_url":"git://github.com/simbody/simbody.git","ssh_url":"git@github.com:simbody/simbody.git","clone_url":"https://github.com/simbody/simbody.git","svn_url":"https://github.com/simbody/simbody","homepage":"https://simtk.org/home/simbody","size":197016,"stargazers_count":489,"watchers_count":489,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":169,"mirror_url":null,"open_issues_count":75,"forks":169,"open_issues":75,"watchers":489,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/simbody/simbody/pulls/467"},"html":{"href":"https://github.com/simbody/simbody/pull/467"},"issue":{"href":"https://api.github.com/repos/simbody/simbody/issues/467"},"comments":{"href":"https://api.github.com/repos/simbody/simbody/issues/467/comments"},"review_comments":{"href":"https://api.github.com/repos/simbody/simbody/pulls/467/comments"},"review_comment":{"href":"https://api.github.com/repos/simbody/simbody/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/simbody/simbody/pulls/467/commits"},"statuses":{"href":"https://api.github.com/repos/simbody/simbody/statuses/2734ae16dc919f344cb9edd4a431193dd5626ed3"}}}}