{"id":13417886,"url":"https://github.com/ericniebler/range-v3","last_synced_at":"2025-05-12T15:16:11.540Z","repository":{"id":11769414,"uuid":"14305727","full_name":"ericniebler/range-v3","owner":"ericniebler","description":"Range library for C++14/17/20, basis for C++20's std::ranges","archived":false,"fork":false,"pushed_at":"2025-03-23T13:57:05.000Z","size":34412,"stargazers_count":4225,"open_issues_count":283,"forks_count":454,"subscribers_count":154,"default_branch":"master","last_synced_at":"2025-04-23T17:17:33.172Z","etag":null,"topics":["c-plus-plus","iterator","proposal","range","range-library"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericniebler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-11-11T16:05:48.000Z","updated_at":"2025-04-22T16:01:22.000Z","dependencies_parsed_at":"2023-02-17T01:30:48.441Z","dependency_job_id":"7b1a2359-100d-4f32-9947-74ea84f3d0c8","html_url":"https://github.com/ericniebler/range-v3","commit_stats":{"total_commits":1806,"total_committers":133,"mean_commits":"13.578947368421053","dds":0.632890365448505,"last_synced_commit":"9aa41d6b8ded2cf5e8007e66a0efd1ab33dbf9a5"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericniebler%2Frange-v3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericniebler%2Frange-v3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericniebler%2Frange-v3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericniebler%2Frange-v3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericniebler","download_url":"https://codeload.github.com/ericniebler/range-v3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250477820,"owners_count":21437049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","iterator","proposal","range","range-library"],"created_at":"2024-07-30T22:00:54.779Z","updated_at":"2025-04-23T17:17:43.568Z","avatar_url":"https://github.com/ericniebler.png","language":"C++","funding_links":[],"categories":["TODO scan for Android support in followings","C++","C/C++程序设计","Standard/Support Libraries","Libraries","Projects built with Bazel"],"sub_categories":["资源传输下载","Misc","non-Google projects"],"readme":"[![range-v3 CI](https://github.com/ericniebler/range-v3/actions/workflows/range-v3-ci.yml/badge.svg)](https://github.com/ericniebler/range-v3/actions/workflows/range-v3-ci.yml)\n\nrange-v3\n========\n\nRange library for C++14/17/20. This code was the basis of [a formal proposal](https://ericniebler.github.io/std/wg21/D4128.html) to add range support to the C++ standard library. That proposal evolved through a Technical Specification, and finally into [P0896R4 \"The One Ranges Proposal\"](https://wg21.link/p0896r4) which was merged into the C++20 working drafts in November 2018.\n\nAbout:\n------\n\nRanges are an extension of the Standard Template Library that makes its iterators and algorithms more powerful by making them _composable_. Unlike other range-like solutions which seek to do away with iterators, in range-v3 ranges are an abstraction layer _on top_ of iterators.\n\nRange-v3 is built on three pillars: Views, Actions, and Algorithms. The algorithms are the same as those with which you are already familiar in the STL, except that in range-v3 all the algorithms have overloads that take ranges in addition to the overloads that take iterators. Views are composable adaptations of ranges where the adaptation happens lazily as the view is iterated. And an action is an eager application of an algorithm to a container that mutates the container in-place and returns it for further processing.\n\nViews and actions use the pipe syntax (e.g., `rng | adapt1 | adapt2 | ...`) so your code is terse and readable from left to right.\n\nDocumentation:\n--------------\n\nCheck out the (woefully incomplete) documentation [here](https://ericniebler.github.io/range-v3/).\n\nOther resources (mind the dates, the library probably has changed since then):\n\n- Usage:\n  - Talk: [CppCon 2015: Eric Niebler \"Ranges for the Standard Library\"](https://www.youtube.com/watch?v=mFUXNMfaciE), 2015.\n  - [A slice of Python in C++](http://ericniebler.com/2014/12/07/a-slice-of-python-in-c/), 07.12.2014.\n  - Actions (back then called [Container Algorithms](http://ericniebler.com/2014/11/23/container-algorithms/)), 23.11.2014.\n  - [Range comprehensions](http://ericniebler.com/2014/04/27/range-comprehensions/), 27.04.2014.\n  - [Input iterators vs input ranges](http://ericniebler.com/2013/11/07/input-iterators-vs-input-ranges/), 07.11.2013.\n\n- Design / Implementation:\n  - Rationale behind range-v3: [N4128: Ranges for the standard library Revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4128.html), 2014.\n  - Ranges TS: [N4560: C++ Extensions for Ranges](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4560.pdf), 2015.\n  - Implementation of customization points in range-v3:\n    - [N4381: Suggested Design for Customization Points](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4381.html), 2015.\n    - [P0386: Inline variables](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0386r0.pdf), 2016.\n    - [Customization Point Design in C++11 and Beyond](http://ericniebler.com/2014/10/21/customization-point-design-in-c11-and-beyond/), 2014.\n  - Proxy iterators in range-v3:\n    - [D0022: Proxy Iterators for the Ranges Extensions](https://ericniebler.github.io/std/wg21/D0022.html).\n    - [To Be or Not to Be (an Iterator)](http://ericniebler.com/2015/01/28/to-be-or-not-to-be-an-iterator/), 2015.\n    - [Iterators++: Part1](http://ericniebler.com/2015/02/03/iterators-plus-plus-part-1/), 2015.\n    - [Iterators++: Part2](http://ericniebler.com/2015/02/13/iterators-plus-plus-part-2/), 2015.\n    - [Iterators++: Part3](http://ericniebler.com/2015/03/03/iterators-plus-plus-part-3/), 2015.\n  - Metaprogramming utilities:\n    - See the [meta documentation](https://ericniebler.github.io/meta/index.html), the library has changed significantly since the [2014 blog post](http://ericniebler.com/2014/11/13/tiny-metaprogramming-library/).\n  - Concept emulation layer: [Concept checking in C++11](http://ericniebler.com/2013/11/23/concept-checking-in-c11/), 2013.\n  - [C++Now 2014: Eric Niebler \"C++11 Library Design\"](https://www.youtube.com/watch?v=zgOF4NrQllo), 2014.\n\nLicense:\n--------\n\nMost of the source code in this project are mine, and those are under the Boost Software License. Parts are taken from Alex Stepanov's Elements of Programming, Howard Hinnant's libc++, and from the SGI STL. Please see the attached LICENSE file and the CREDITS file for the licensing and acknowledgments.\n\nSupported Compilers\n-------------------\n\nThe code is known to work on the following compilers:\n\n- clang 5.0 (or later)\n- GCC 6.5 (or later)\n- Clang/LLVM 6 (or later) on Windows (older versions may work - we haven't tested.)\n- Visual Studio 2019 (or later) on Windows, with some caveats due to range-v3's strict conformance requirements:\n  - range-v3 needs `/permissive-` and either `/std:c++latest`, `/std:c++20`,  or `/std:c++17`\n\n**Development Status:** This code is fairly stable, well-tested, and suitable for casual use, although currently lacking documentation. _In general_, no promise is made about support or long-term stability. This code *will* evolve without regard to backwards compatibility.\n\nA notable exception is anything found within the `ranges::cpp20` namespace. Those components will change rarely or (preferably) never at all.\n\n**Build status**\n- on GitHub Actions: [![GitHub Actions Status](https://github.com/ericniebler/range-v3/workflows/range-v3%20CI/badge.svg?branch=master)](https://github.com/ericniebler/range-v3/actions)\n\nBuilding range-v3 - Using vcpkg\n-------------------------------\n\nYou can download and install range-v3 using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:\n```sh\ngit clone https://github.com/Microsoft/vcpkg.git\ncd vcpkg\n./bootstrap-vcpkg.sh\n./vcpkg integrate install\n./vcpkg install range-v3\n```\nThe range-v3 port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.\n\nBuilding range-v3 - Using Conan\n-------------------------------\n\nYou can install pre-built binaries for range-v3 or build it from source using [Conan](https://conan.io/).\n\nSetup your `CMakeLists.txt`:\n```cmake\nproject(myproject CXX)\n\nadd_executable(${PROJECT_NAME} main.cpp)\nfind_package(range-v3 REQUIRED)\ntarget_link_libraries(${PROJECT_NAME} range-v3::range-v3)\n```\nCreate a `conanfile.txt`:\n```\n[requires]\nrange-v3/[*]\n\n[generators]\nCMakeDeps\nCMakeToolchain\n```\nRun following commands:\n```sh\n$ conan install . --build=missing --output-folder=build\n$ cmake . -B build -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake\n$ cmake --build build\n```\nFor detailed instructions on how to use Conan, please refer to the [Conan documentation](https://docs.conan.io/2/).\n\nThe range-v3 package in Conan Center is kept up to date by Conan team members and Conan community contributors.\nIf the version is out of date, please [create an issue or pull request](https://github.com/conan-io/conan-center-index) on the conan repository.\n\nBuilding range-v3 - Using `build2`\n----------------------------------\n\nYou can use [`build2`](https://build2.org), a dependency manager and build-system combined, to use `range-v3` (or work on it):\n\nCurrently this package is available in these package repositories:\n - **https://cppget.org/range-v3/** for released and published versions.\n - [**The git repository with the sources of the `build2` package of `range-v3`**](https://github.com/build2-packaging/range-v3.git) for unreleased or custom revisions of `range-v3`, or for working on it with `build2`.\n\n### Usage:\n\n - `build2` package name: `range-v3`\n - Library target name : `lib{range-v3}`\n - [Detailed use cases and instructions in this document](https://github.com/build2-packaging/range-v3/blob/master/NOTES-build2.md).\n\nFor example, to make your `build2` project depend on `range-v3`:\n  - Add one of the repositories to your configurations, or in your `repositories.manifest`, if not already there; for example:\n    ```\n    :\n    role: prerequisite\n    location: https://pkg.cppget.org/1/alpha # v0.11.0 is there.\n    ```\n  - Add this package as a dependency to your `manifest` file (example for `v0.11.x`):\n    ```\n    depends: range-v3 ~0.11.0\n    ```\n  - Import the target and use it as a prerequisite to your own target using `range-v3` in the appropriate `buildfile`:\n    ```py\n    import range_v3 = range-v3%lib{range-v3}\n\n    lib{mylib} : cxx{**} ... $range_v3\n    ```\n\nThen just build your project as usual (with `b` or `bdep update`), `build2` will figure out the rest.\n\nFor `build2` newcomers or to get more details and use cases, you can read [this document](https://github.com/build2-packaging/range-v3/blob/master/NOTES-build2.md) and the [`build2` toolchain introduction](https://build2.org/build2-toolchain/doc/build2-toolchain-intro.xhtml).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericniebler%2Frange-v3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericniebler%2Frange-v3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericniebler%2Frange-v3/lists"}