{"id":20743241,"url":"https://github.com/karmakrafts/kstd-streams","last_synced_at":"2025-05-11T03:33:17.580Z","repository":{"id":148660183,"uuid":"619316503","full_name":"karmakrafts/kstd-streams","owner":"karmakrafts","description":"Highly optimized, constexpr-ready collection streams for C++17/20.","archived":true,"fork":false,"pushed_at":"2024-02-07T22:57:46.000Z","size":214,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T22:12:45.486Z","etag":null,"topics":["cplusplus","cplusplus-17","cplusplus-20","cpp","cpp-library","cpp-programming","cpp20","cpp20-library","cross-platform","cross-platform-library","functional-programming","header-only","header-only-library","library","streams","streams-api"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/karmakrafts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-03-26T21:51:40.000Z","updated_at":"2025-02-20T22:59:34.000Z","dependencies_parsed_at":"2024-02-07T23:47:29.735Z","dependency_job_id":null,"html_url":"https://github.com/karmakrafts/kstd-streams","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karmakrafts%2Fkstd-streams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karmakrafts%2Fkstd-streams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karmakrafts%2Fkstd-streams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karmakrafts%2Fkstd-streams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karmakrafts","download_url":"https://codeload.github.com/karmakrafts/kstd-streams/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253514352,"owners_count":21920327,"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":["cplusplus","cplusplus-17","cplusplus-20","cpp","cpp-library","cpp-programming","cpp20","cpp20-library","cross-platform","cross-platform-library","functional-programming","header-only","header-only-library","library","streams","streams-api"],"created_at":"2024-11-17T07:09:43.447Z","updated_at":"2025-05-11T03:33:17.203Z","avatar_url":"https://github.com/karmakrafts.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://raw.githubusercontent.com/karmakrafts/kstd-streams/master/branding/logo.svg\" width=\"6%\"\u003e\u003c/img\u003e kstd-streams\n\nAre you looking for map, filter, reduce and more on any standard container?  \nDo you want it to be a constexpr-ready zero-cost abstraction?  \n**Look no further!**\n\nkstd-streams is a highly optimized, constexpr-ready collection stream library for C++20.  \n\n### Cloning kstd-streams\n\nIf you clone this repository for whatever purpose, don't forget to initialize the submodules using the following command:\n\n```shell\ngit submodule update --init\n```\n\n### Using kstd-streams\n\nIn order to use the stream API, simply make sure you include the kstd-streams header:\n\n```cpp\n#include \u003ckstd/streams/stream.hpp\u003e\n```\n\n### Why streams are amazing\n\nAs an example, let's use computing the sum of all elements within a `std::vector\u003cint\u003e`.  \nSimple enough, right? If you've got some experience with programming in C++, your solution\nwould most likely look somewhat like this:\n\n```cpp\nstd::vector\u003cint\u003e elements(...);\nauto sum = 0;\nfor(const auto element : elements) {\n    sum += element;\n}\n```\n\nThat is quite a lot of code for such a simple operation, but that's what you get with a language as verbose as C++..  \nNow let's take a look at the kstd-streams equivalent to that code:\n\n```cpp\nstd::vector\u003cint\u003e elements(...);\nconst auto sum = kstd::streams::stream(elements).sum();\n```\n\nAs long as the stream value type (`int` in our case) provides an implementation for `operator+` you can use the sum operation\nto sum up all the elements operated upon by the stream.\n\nWe effectively reduced the amount of code required by three quarters! Of course, you can do a lot more with streams than just \ncalculating the sum of a set of elements.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarmakrafts%2Fkstd-streams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarmakrafts%2Fkstd-streams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarmakrafts%2Fkstd-streams/lists"}