{"id":21035192,"url":"https://github.com/fabienpean/vectr","last_synced_at":"2026-05-17T21:33:23.758Z","repository":{"id":88062987,"uuid":"299739075","full_name":"FabienPean/vectr","owner":"FabienPean","description":"A type-erased sequential container  to store any kind of type uniformly","archived":false,"fork":false,"pushed_at":"2020-09-29T22:18:42.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-02T02:24:17.787Z","etag":null,"topics":["container","cpp","type-erasure","vector"],"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/FabienPean.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":"2020-09-29T21:11:41.000Z","updated_at":"2020-09-29T22:25:46.000Z","dependencies_parsed_at":"2023-03-12T17:15:31.407Z","dependency_job_id":null,"html_url":"https://github.com/FabienPean/vectr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FabienPean/vectr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabienPean%2Fvectr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabienPean%2Fvectr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabienPean%2Fvectr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabienPean%2Fvectr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FabienPean","download_url":"https://codeload.github.com/FabienPean/vectr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabienPean%2Fvectr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33155666,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"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":["container","cpp","type-erasure","vector"],"created_at":"2024-11-19T13:09:55.340Z","updated_at":"2026-05-17T21:33:23.753Z","avatar_url":"https://github.com/FabienPean.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VECTR\n\n## Example\n\n```cpp\n#include \"vectr.h\"\n#include \u003ciostream\u003e\n#include \u003cunordered_map\u003e\nint main()\n{\n    using namespace vectr;\n    std::unordered_map\u003cint,vecter\u003e map;\n    map[0] = vecter::create\u003cdouble\u003e();\n    map[1] = vecter::create\u003csize_t\u003e();\n    map[0].vector\u003cdouble\u003e().push_back(3.14);\n    map[1].vector\u003csize_t\u003e().push_back(42);\n    map[0].vector\u003cdouble\u003e().push_back(1.44);\n    for(auto\u0026 v: map[0].vector\u003cdouble\u003e()) std::cout \u003c\u003c v \u003c\u003c \" \";// prints \"3.14 1.44\"\n    for(auto\u0026 v: map[1].vector\u003csize_t\u003e()) std::cout \u003c\u003c v \u003c\u003c \" \";// prints \"42\"\n}\n```\n\n## What?\n\nThis repository provides an experimental container which is attempts to be a generalized sequential container. Each `vecter` can store any type and can be safely rebind to store other types.\n\n## Why?\n\nFor fun and education primarily.\n\nA more concrete application is to reduce the amount of indirections for _data frame_ kind of containers. In general, they rely on data structure with a minimum of two indirections. Given in term of (simplified) C++, as a `map\u003ctype_index,unique_ptr\u003cvoid\u003e\u003e`. This container leads to a single indirection by replacing the `unique_ptr` by the type-erased content of a `std::vector`\n\n## How?\n\n`vecter` is inherited by `vecter_impl\u003cT\u003e`. The former contains 32 bytes of information which describes its content, while the latter type provides the methods to interpret correctly its content.\n\n* a pointer to a structure containing general information and methods on the actual type stored (size, alignment, destructor, etc)\n* a pointer to the beginning of the buffer\n* a pointer to the end of the existing content within the buffer\n* a pointer to the end of the whole allocated buffer\n\nThe user is responsible to know what type is stored in a `vecter` to be able to use it. However, the basic operations such as destruction/copy/move are safely done.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabienpean%2Fvectr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabienpean%2Fvectr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabienpean%2Fvectr/lists"}