{"id":17343157,"url":"https://github.com/o-rumiantsev/array","last_synced_at":"2026-01-19T18:31:17.486Z","repository":{"id":107634371,"uuid":"129612462","full_name":"o-rumiantsev/Array","owner":"o-rumiantsev","description":"Compromise between the convenient and fast implementation of arrays in C++","archived":false,"fork":false,"pushed_at":"2018-04-17T09:10:20.000Z","size":17,"stargazers_count":2,"open_issues_count":6,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-06T11:50:01.319Z","etag":null,"topics":["array","cpp","features","functionality","list","speed"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/o-rumiantsev.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,"publiccode":null,"codemeta":null}},"created_at":"2018-04-15T13:24:24.000Z","updated_at":"2021-04-05T16:33:05.000Z","dependencies_parsed_at":"2023-06-08T15:45:26.399Z","dependency_job_id":null,"html_url":"https://github.com/o-rumiantsev/Array","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/o-rumiantsev/Array","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o-rumiantsev%2FArray","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o-rumiantsev%2FArray/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o-rumiantsev%2FArray/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o-rumiantsev%2FArray/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/o-rumiantsev","download_url":"https://codeload.github.com/o-rumiantsev/Array/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o-rumiantsev%2FArray/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28580148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T18:29:59.827Z","status":"ssl_error","status_checked_at":"2026-01-19T18:29:40.878Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["array","cpp","features","functionality","list","speed"],"created_at":"2024-10-15T16:08:39.237Z","updated_at":"2026-01-19T18:31:17.472Z","avatar_url":"https://github.com/o-rumiantsev.png","language":"C++","readme":"# Array\n\nThis is an attempt to improve arrays in C++. Not only make it look like JS arrays, but partly save its advantage - direct access to its elements.\n\n# Mechanism\n\n`Array` class wraps a singly linked list, which nodes has two fields: `slice` and `next`. `slice` is a C/C++ array.\nThe constructor of an `Array` takes one argument - `size`. This is the size of one slice, which contains in one list node.\nWhen user want to use more memory, there will be allocated one more array and push it to the list.\n\n\n```\n                             Array class\n    \n         List   o —---------------\u003e o —-----------\u003e o\n                |                   |               |\nMemory [ ... | |x|x|x|x| | | ... | |x|x|x|x| | ... |x|x|x|x| | ...  ]\n                 slice               slice           slice\n```\n\n\nSo here is an example of how it works:\n```javascript\nArray arr (10); // Initialize an array with size 10\n                // Internal list has one node.\n\n//  do something\n...\n//  10 elements became not enough\n\narr[10] = some_value; // There has allocated one more array on 10 elements inside\n                      // Internal list has two nodes now.\n                      \n\n```\n\n# Features\n\n###  `push()`\n```javascript\n\n// arr [1, 2, 3, 4, 5, 6, 7, 8, 9]\n\narr.push(10);\n\n// arr [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n\n```\n\n### `pop()`\n```javascript\n\n// arr [1, 2, 3, 4]\n\nint last = arr.pop();\n\n// last = 4, arr [1, 2, 3]\n\n```\n\n### `map()`\n```javascript\n\n// arr [1, 2, 3, 4]\n\nArray double_arr = arr.map([](int item) { return item * 2; });\n\n// double_arr [2, 4, 6, 8], arr [1, 2, 3, 4]\n\n```\n\n### `filter()`\n```javascript\n\n// arr [1, 2, 3, 4]\n\nArray filtered = arr.filter([](int item) { return item % 2 == 0; });\n\n// filtered [2, 4], arr [1, 2, 3, 4]\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo-rumiantsev%2Farray","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fo-rumiantsev%2Farray","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo-rumiantsev%2Farray/lists"}