{"id":18689268,"url":"https://github.com/endail/expandingarray","last_synced_at":"2026-05-03T09:38:15.215Z","repository":{"id":52592023,"uuid":"336764414","full_name":"endail/ExpandingArray","owner":"endail","description":"A dynamic array for use on Arduino","archived":false,"fork":false,"pushed_at":"2021-04-24T11:20:35.000Z","size":12,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-28T01:40:12.685Z","etag":null,"topics":["arduino","array","cpp","dynamicarray"],"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/endail.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}},"created_at":"2021-02-07T10:59:51.000Z","updated_at":"2021-04-24T11:20:37.000Z","dependencies_parsed_at":"2022-08-25T11:40:18.805Z","dependency_job_id":null,"html_url":"https://github.com/endail/ExpandingArray","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/endail%2FExpandingArray","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endail%2FExpandingArray/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endail%2FExpandingArray/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endail%2FExpandingArray/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/endail","download_url":"https://codeload.github.com/endail/ExpandingArray/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239549993,"owners_count":19657538,"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":["arduino","array","cpp","dynamicarray"],"created_at":"2024-11-07T10:41:56.237Z","updated_at":"2025-11-08T05:30:37.572Z","avatar_url":"https://github.com/endail.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExpandingArray\n\nA lightweight template array. I use this with the Arduino platform.\n\n[![lint status](https://github.com/endail/ExpandingArray/workflows/arduino-lint/badge.svg?event=push)](https://github.com/endail/ExpandingArray/actions?query=workflow%3Aarduino-lint)\n\n```c++\n//ExpandingArray can take two template parameters\n//StorageType: the data type being stored in the array (default is uint8_t)\n//IndexType: the data type being used to index the array (default is size_t)\n\nendail::ExpandingArray byteArr(100); //create an array of 100 bytes\nendail::ExpandingArray\u003cint\u003e intArr(arr2, sizeof(arr2)); //create an array of ints by copying all the data from arr2\nendail::ExpandingArray\u003cchar, uint8_t\u003e charArr; //create an array of char using uint8_t as the indexing type\nendail::ExpandingArray\u003cchar, uint8_t\u003e charArr2 = charArr; //create charArr2 by copying all the data from charArr\nendail::ExpandingArray\u003cint\u003e arr(5); //create an array of ints with 5 elements\n\narr[0] = 61;\nstd::cout \u003c\u003c arr[0]; //61\nint* ptrToSixtyOne = arr.ptr(0);\nsize_t indexOfSixtyOne = arr.idx(ptrToSixtyOne);\n\nfor(auto it = arr.ptr(); it != arr.end(); ++it) {\n    std::cout \u003c\u003c *it \u003c\u003c std::endl;\n}\n\narr.length(); //5\narr.allocate(10); //allocate memory for 10 ints\narr.length(); //still 5\narr.reclaim(); //excess memory is deallocated\narr.length(); //still 5\n\narr.allocate(20); //allocate memory for 20 ints\narr.resize(20); //resize to 20 ints; no memory reallocation needed\narr.length(); //20\n\narr.copyFrom(arr2, sizeof(arr2)); //copy all of arr2 into arr beginning at arr[0]\narr.copyFromAt(arr2, sizeof(arr2), 7); //copy all of arr2 into arr beginning at arr[7]\narr.copyTo(arr2); //copy all of arr into arr2\narr.copyTo(arr2, 3); //copy first 3 elements of arr into arr2\narr.copyToAt(arr2, 5, 4); //copy 5 elements beginning at index 4 from arr into arr2\n\narr.clear(); //clear the array; ints remain in memory\narr.clear(true); //clear the array; ints are zero'd out\n\narr.dispose(); //clear the array; memory is deallocated\narr.dispose(true); //clear the array; ints are zero'd out; memory is deallocated\n\n//dispose is automatically called by the destructor when arr falls out of scope!\n//memory is cleaned up!\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendail%2Fexpandingarray","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fendail%2Fexpandingarray","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendail%2Fexpandingarray/lists"}