{"action":"created","comment":{"url":"https://api.github.com/repos/CaseyCarter/cmcstl2/pulls/comments/205982831","pull_request_review_id":141349614,"id":205982831,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTk4MjgzMQ==","diff_hunk":"@@ -0,0 +1,228 @@\n+// cmcstl2 - A concept-enabled C++ standard library\n+//\n+//  Copyright Casey Carter\n+//  Copyright Eric Niebler\n+//  Copyright Christopher Di Bella\n+//\n+//  Use, modification and distribution is subject to the\n+//  Boost Software License, Version 1.0. (See accompanying\n+//  file LICENSE_1_0.txt or copy at\n+//  http://www.boost.org/LICENSE_1_0.txt)\n+//\n+// Project home: https://github.com/caseycarter/cmcstl2\n+//\n+#ifndef STL2_VIEW_DROP_HPP\n+#define STL2_VIEW_DROP_HPP\n+\n+#include <stl2/detail/fwd.hpp>\n+#include <stl2/detail/meta.hpp>\n+#include <stl2/detail/semiregular_box.hpp>\n+#include <stl2/detail/iterator/concepts.hpp>\n+#include <stl2/detail/functional/invoke.hpp>\n+#include <stl2/detail/range/access.hpp>\n+#include <stl2/detail/range/concepts.hpp>\n+#include <stl2/detail/view/view_closure.hpp>\n+#include <stl2/view/all.hpp>\n+#include <stl2/view/view_interface.hpp>\n+\n+STL2_OPEN_NAMESPACE {\n+\tnamespace ext {\n+\t\ttemplate <Range R>\n+\t\trequires\n+\t\t\tView<R>\n+\t\tstruct drop_view;\n+\n+\t\ttemplate <Range R>\n+\t\trequires\n+\t\t\tView<R>\n+\t\tclass __drop_view : public view_interface<drop_view<R>> {\n+\t\t\tusing D = iter_difference_t<iterator_t<R>>;\n+\n+\t\t\ttemplate <bool Const>\n+\t\t\tstruct __sentinel;\n+\t\tpublic:\n+\t\t\t__drop_view() = default;\n+\n+\t\t\tconstexpr __drop_view(R base, D count)\n+\t\t\t\t: base_(std::move(base)),\n+\t\t\t\t  count_(count)\n+\t\t\t{}\n+\n+\t\t\ttemplate <Range O>\n+\t\t\trequires\n+\t\t\t\text::ViewableRange<O> &&\n+\t\t\t\t_ConstructibleFromRange<R, O>\n+\t\t\tconstexpr __drop_view(O&& o, D count)\n+\t\t\t\t: base_(view::all(std::forward<O>(o))),\n+\t\t\t\t  count_(count)\n+\t\t\t{}\n+\n+\t\t\tconstexpr R base() const\n+\t\t\t{\n+\t\t\t\treturn base_;\n+\t\t\t}\n+\n+\t\t\tconstexpr auto begin()\n+\t\t\t{\n+\t\t\t\treturn begin_impl(*this);\n+\t\t\t}\n+\n+\t\t\tconstexpr auto begin() const\n+\t\t\trequires\n+\t\t\t\tRange<R const>\n+\t\t\t{\n+\t\t\t\treturn begin_impl(*this);\n+\t\t\t}\n+\n+\t\t\tconstexpr auto begin()\n+\t\t\trequires\n+\t\t\t\tSizedRange<R>\n+\t\t\t{\n+\t\t\t\treturn begin_impl(*this);\n+\t\t\t}\n+\n+\t\t\tconstexpr auto begin() const\n+\t\t\trequires\n+\t\t\t\tSizedRange<R const>\n+\t\t\t{\n+\t\t\t\treturn begin_impl(*this);\n+\t\t\t}\n+\n+\t\t\tconstexpr auto end()\n+\t\t\t{\n+\t\t\t\treturn __sentinel<SimpleView<R>>(__stl2::end(base_));\n+\t\t\t}\n+\n+\t\t\tconstexpr auto end() const\n+\t\t\trequires\n+\t\t\t\tRange<R const>\n+\t\t\t{\n+\t\t\t\treturn __sentinel<true>(__stl2::end(base_));\n+\t\t\t}\n+\n+\t\t\tconstexpr auto size() const\n+\t\t\trequires\n+\t\t\t\tSizedRange<R>\n+\t\t\t{\n+\t\t\t\treturn __stl2::distance(base_) < count_ ? 0 : __stl2::distance(base_) - count_;\n+\t\t\t}\n+\t\tprivate:\n+\t\t\tR base_;\n+\t\t\tD count_;\n+\n+\t\t\ttemplate <class X>\n+\t\t\tstatic constexpr decltype(auto) begin_impl(X&& x)\n+\t\t\t{\n+\t\t\t\treturn __stl2::next(__stl2::begin(x.base_), x.count_);\n+\t\t\t}\n+\n+\t\t\ttemplate <class X>\n+\t\t\tstatic constexpr decltype(auto) begin_impl(X&& x)\n+\t\t\trequires\n+\t\t\t\tSizedRange<R>\n+\t\t\t{\n+\t\t\t\tD const dist = __stl2::distance(x.base_);\n+\t\t\t\treturn (__stl2::next(__stl2::begin(x.base_), dist < x.count_ ? dist : x.count_));","path":"include/stl2/view/drop.hpp","position":125,"original_position":125,"commit_id":"5dcdefba7824f794ec3dc58397041dab9523d7fb","original_commit_id":"5dcdefba7824f794ec3dc58397041dab9523d7fb","user":{"login":"CaseyCarter","id":456873,"node_id":"MDQ6VXNlcjQ1Njg3Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/456873?v=4","gravatar_id":"","url":"https://api.github.com/users/CaseyCarter","html_url":"https://github.com/CaseyCarter","followers_url":"https://api.github.com/users/CaseyCarter/followers","following_url":"https://api.github.com/users/CaseyCarter/following{/other_user}","gists_url":"https://api.github.com/users/CaseyCarter/gists{/gist_id}","starred_url":"https://api.github.com/users/CaseyCarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaseyCarter/subscriptions","organizations_url":"https://api.github.com/users/CaseyCarter/orgs","repos_url":"https://api.github.com/users/CaseyCarter/repos","events_url":"https://api.github.com/users/CaseyCarter/events{/privacy}","received_events_url":"https://api.github.com/users/CaseyCarter/received_events","type":"User","site_admin":false},"body":"And now the nasty part: this is `O(1)` for random access ranges, but nothing weaker. For weaker underlying ranges, we need to cache the first iterator in a `detail::non_propagating_cache`. (`reverse_view` is a good example.) Consequently, the `const` overloads of `begin` and `end` need to be enabled only when `R` models `RandomAccessRange`.","created_at":"2018-07-29T18:16:09Z","updated_at":"2018-07-29T18:20:52Z","html_url":"https://github.com/CaseyCarter/cmcstl2/pull/177#discussion_r205982831","pull_request_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/pulls/177","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/CaseyCarter/cmcstl2/pulls/comments/205982831"},"html":{"href":"https://github.com/CaseyCarter/cmcstl2/pull/177#discussion_r205982831"},"pull_request":{"href":"https://api.github.com/repos/CaseyCarter/cmcstl2/pulls/177"}},"in_reply_to_id":205982475},"pull_request":{"url":"https://api.github.com/repos/CaseyCarter/cmcstl2/pulls/177","id":204642498,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0NjQyNDk4","html_url":"https://github.com/CaseyCarter/cmcstl2/pull/177","diff_url":"https://github.com/CaseyCarter/cmcstl2/pull/177.diff","patch_url":"https://github.com/CaseyCarter/cmcstl2/pull/177.patch","issue_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/issues/177","number":177,"state":"open","locked":false,"title":"Added view::ext::drop and tests.","user":{"login":"cjdb","id":8622748,"node_id":"MDQ6VXNlcjg2MjI3NDg=","avatar_url":"https://avatars3.githubusercontent.com/u/8622748?v=4","gravatar_id":"","url":"https://api.github.com/users/cjdb","html_url":"https://github.com/cjdb","followers_url":"https://api.github.com/users/cjdb/followers","following_url":"https://api.github.com/users/cjdb/following{/other_user}","gists_url":"https://api.github.com/users/cjdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cjdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjdb/subscriptions","organizations_url":"https://api.github.com/users/cjdb/orgs","repos_url":"https://api.github.com/users/cjdb/repos","events_url":"https://api.github.com/users/cjdb/events{/privacy}","received_events_url":"https://api.github.com/users/cjdb/received_events","type":"User","site_admin":false},"body":"Here's an attempt at `drop`, influenced by `take` (but not range-v3's `drop`). Tests are from range-v3. `drop_exactly`, `drop_while`, and `take_while` to come soon.","created_at":"2018-07-29T13:34:05Z","updated_at":"2018-07-29T18:20:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e52e2702cc6366e3e7887cec30d57864ae7aaf6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/pulls/177/commits","review_comments_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/pulls/177/comments","review_comment_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/issues/177/comments","statuses_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/statuses/5dcdefba7824f794ec3dc58397041dab9523d7fb","head":{"label":"cjdb:extension-views","ref":"extension-views","sha":"5dcdefba7824f794ec3dc58397041dab9523d7fb","user":{"login":"cjdb","id":8622748,"node_id":"MDQ6VXNlcjg2MjI3NDg=","avatar_url":"https://avatars3.githubusercontent.com/u/8622748?v=4","gravatar_id":"","url":"https://api.github.com/users/cjdb","html_url":"https://github.com/cjdb","followers_url":"https://api.github.com/users/cjdb/followers","following_url":"https://api.github.com/users/cjdb/following{/other_user}","gists_url":"https://api.github.com/users/cjdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cjdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjdb/subscriptions","organizations_url":"https://api.github.com/users/cjdb/orgs","repos_url":"https://api.github.com/users/cjdb/repos","events_url":"https://api.github.com/users/cjdb/events{/privacy}","received_events_url":"https://api.github.com/users/cjdb/received_events","type":"User","site_admin":false},"repo":{"id":67266966,"node_id":"MDEwOlJlcG9zaXRvcnk2NzI2Njk2Ng==","name":"cmcstl2","full_name":"cjdb/cmcstl2","owner":{"login":"cjdb","id":8622748,"node_id":"MDQ6VXNlcjg2MjI3NDg=","avatar_url":"https://avatars3.githubusercontent.com/u/8622748?v=4","gravatar_id":"","url":"https://api.github.com/users/cjdb","html_url":"https://github.com/cjdb","followers_url":"https://api.github.com/users/cjdb/followers","following_url":"https://api.github.com/users/cjdb/following{/other_user}","gists_url":"https://api.github.com/users/cjdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cjdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjdb/subscriptions","organizations_url":"https://api.github.com/users/cjdb/orgs","repos_url":"https://api.github.com/users/cjdb/repos","events_url":"https://api.github.com/users/cjdb/events{/privacy}","received_events_url":"https://api.github.com/users/cjdb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cjdb/cmcstl2","description":"An implementation of C++ Extensions for Ranges","fork":true,"url":"https://api.github.com/repos/cjdb/cmcstl2","forks_url":"https://api.github.com/repos/cjdb/cmcstl2/forks","keys_url":"https://api.github.com/repos/cjdb/cmcstl2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cjdb/cmcstl2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cjdb/cmcstl2/teams","hooks_url":"https://api.github.com/repos/cjdb/cmcstl2/hooks","issue_events_url":"https://api.github.com/repos/cjdb/cmcstl2/issues/events{/number}","events_url":"https://api.github.com/repos/cjdb/cmcstl2/events","assignees_url":"https://api.github.com/repos/cjdb/cmcstl2/assignees{/user}","branches_url":"https://api.github.com/repos/cjdb/cmcstl2/branches{/branch}","tags_url":"https://api.github.com/repos/cjdb/cmcstl2/tags","blobs_url":"https://api.github.com/repos/cjdb/cmcstl2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cjdb/cmcstl2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cjdb/cmcstl2/git/refs{/sha}","trees_url":"https://api.github.com/repos/cjdb/cmcstl2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cjdb/cmcstl2/statuses/{sha}","languages_url":"https://api.github.com/repos/cjdb/cmcstl2/languages","stargazers_url":"https://api.github.com/repos/cjdb/cmcstl2/stargazers","contributors_url":"https://api.github.com/repos/cjdb/cmcstl2/contributors","subscribers_url":"https://api.github.com/repos/cjdb/cmcstl2/subscribers","subscription_url":"https://api.github.com/repos/cjdb/cmcstl2/subscription","commits_url":"https://api.github.com/repos/cjdb/cmcstl2/commits{/sha}","git_commits_url":"https://api.github.com/repos/cjdb/cmcstl2/git/commits{/sha}","comments_url":"https://api.github.com/repos/cjdb/cmcstl2/comments{/number}","issue_comment_url":"https://api.github.com/repos/cjdb/cmcstl2/issues/comments{/number}","contents_url":"https://api.github.com/repos/cjdb/cmcstl2/contents/{+path}","compare_url":"https://api.github.com/repos/cjdb/cmcstl2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cjdb/cmcstl2/merges","archive_url":"https://api.github.com/repos/cjdb/cmcstl2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cjdb/cmcstl2/downloads","issues_url":"https://api.github.com/repos/cjdb/cmcstl2/issues{/number}","pulls_url":"https://api.github.com/repos/cjdb/cmcstl2/pulls{/number}","milestones_url":"https://api.github.com/repos/cjdb/cmcstl2/milestones{/number}","notifications_url":"https://api.github.com/repos/cjdb/cmcstl2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cjdb/cmcstl2/labels{/name}","releases_url":"https://api.github.com/repos/cjdb/cmcstl2/releases{/id}","deployments_url":"https://api.github.com/repos/cjdb/cmcstl2/deployments","created_at":"2016-09-03T02:36:47Z","updated_at":"2018-07-23T19:52:13Z","pushed_at":"2018-07-29T13:30:03Z","git_url":"git://github.com/cjdb/cmcstl2.git","ssh_url":"git@github.com:cjdb/cmcstl2.git","clone_url":"https://github.com/cjdb/cmcstl2.git","svn_url":"https://github.com/cjdb/cmcstl2","homepage":"","size":2823,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"CaseyCarter:master","ref":"master","sha":"d3a4a6bf40d1f1a4f74e65f81d3c61fb65f85712","user":{"login":"CaseyCarter","id":456873,"node_id":"MDQ6VXNlcjQ1Njg3Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/456873?v=4","gravatar_id":"","url":"https://api.github.com/users/CaseyCarter","html_url":"https://github.com/CaseyCarter","followers_url":"https://api.github.com/users/CaseyCarter/followers","following_url":"https://api.github.com/users/CaseyCarter/following{/other_user}","gists_url":"https://api.github.com/users/CaseyCarter/gists{/gist_id}","starred_url":"https://api.github.com/users/CaseyCarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaseyCarter/subscriptions","organizations_url":"https://api.github.com/users/CaseyCarter/orgs","repos_url":"https://api.github.com/users/CaseyCarter/repos","events_url":"https://api.github.com/users/CaseyCarter/events{/privacy}","received_events_url":"https://api.github.com/users/CaseyCarter/received_events","type":"User","site_admin":false},"repo":{"id":36595246,"node_id":"MDEwOlJlcG9zaXRvcnkzNjU5NTI0Ng==","name":"cmcstl2","full_name":"CaseyCarter/cmcstl2","owner":{"login":"CaseyCarter","id":456873,"node_id":"MDQ6VXNlcjQ1Njg3Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/456873?v=4","gravatar_id":"","url":"https://api.github.com/users/CaseyCarter","html_url":"https://github.com/CaseyCarter","followers_url":"https://api.github.com/users/CaseyCarter/followers","following_url":"https://api.github.com/users/CaseyCarter/following{/other_user}","gists_url":"https://api.github.com/users/CaseyCarter/gists{/gist_id}","starred_url":"https://api.github.com/users/CaseyCarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaseyCarter/subscriptions","organizations_url":"https://api.github.com/users/CaseyCarter/orgs","repos_url":"https://api.github.com/users/CaseyCarter/repos","events_url":"https://api.github.com/users/CaseyCarter/events{/privacy}","received_events_url":"https://api.github.com/users/CaseyCarter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CaseyCarter/cmcstl2","description":"An implementation of C++ Extensions for Ranges","fork":false,"url":"https://api.github.com/repos/CaseyCarter/cmcstl2","forks_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/forks","keys_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/teams","hooks_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/hooks","issue_events_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/issues/events{/number}","events_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/events","assignees_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/assignees{/user}","branches_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/branches{/branch}","tags_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/tags","blobs_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/git/refs{/sha}","trees_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/statuses/{sha}","languages_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/languages","stargazers_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/stargazers","contributors_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/contributors","subscribers_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/subscribers","subscription_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/subscription","commits_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/commits{/sha}","git_commits_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/git/commits{/sha}","comments_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/comments{/number}","issue_comment_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/issues/comments{/number}","contents_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/contents/{+path}","compare_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/merges","archive_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/downloads","issues_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/issues{/number}","pulls_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/pulls{/number}","milestones_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/milestones{/number}","notifications_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/labels{/name}","releases_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/releases{/id}","deployments_url":"https://api.github.com/repos/CaseyCarter/cmcstl2/deployments","created_at":"2015-05-31T08:55:16Z","updated_at":"2018-07-29T18:15:41Z","pushed_at":"2018-07-29T18:15:39Z","git_url":"git://github.com/CaseyCarter/cmcstl2.git","ssh_url":"git@github.com:CaseyCarter/cmcstl2.git","clone_url":"https://github.com/CaseyCarter/cmcstl2.git","svn_url":"https://github.com/CaseyCarter/cmcstl2","homepage":"","size":2728,"stargazers_count":127,"watchers_count":127,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":19,"open_issues":19,"watchers":127,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CaseyCarter/cmcstl2/pulls/177"},"html":{"href":"https://github.com/CaseyCarter/cmcstl2/pull/177"},"issue":{"href":"https://api.github.com/repos/CaseyCarter/cmcstl2/issues/177"},"comments":{"href":"https://api.github.com/repos/CaseyCarter/cmcstl2/issues/177/comments"},"review_comments":{"href":"https://api.github.com/repos/CaseyCarter/cmcstl2/pulls/177/comments"},"review_comment":{"href":"https://api.github.com/repos/CaseyCarter/cmcstl2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CaseyCarter/cmcstl2/pulls/177/commits"},"statuses":{"href":"https://api.github.com/repos/CaseyCarter/cmcstl2/statuses/5dcdefba7824f794ec3dc58397041dab9523d7fb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"CaseyCarter"}}