{"id":18000614,"url":"https://github.com/justasmasiulis/circular_buffer","last_synced_at":"2025-03-26T07:32:12.776Z","repository":{"id":56430194,"uuid":"98754356","full_name":"JustasMasiulis/circular_buffer","owner":"JustasMasiulis","description":"A constexpr STL style circular buffer implementation","archived":false,"fork":false,"pushed_at":"2024-05-02T07:02:58.000Z","size":53,"stargazers_count":71,"open_issues_count":1,"forks_count":18,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-21T11:50:24.097Z","etag":null,"topics":["buffer","circular-buffer","constexpr","cpp","modern","ring-buffer","stl"],"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/JustasMasiulis.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":"2017-07-29T19:25:44.000Z","updated_at":"2024-12-31T16:54:47.000Z","dependencies_parsed_at":"2024-10-29T23:53:32.228Z","dependency_job_id":null,"html_url":"https://github.com/JustasMasiulis/circular_buffer","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/JustasMasiulis%2Fcircular_buffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JustasMasiulis%2Fcircular_buffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JustasMasiulis%2Fcircular_buffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JustasMasiulis%2Fcircular_buffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JustasMasiulis","download_url":"https://codeload.github.com/JustasMasiulis/circular_buffer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245611874,"owners_count":20643916,"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":["buffer","circular-buffer","constexpr","cpp","modern","ring-buffer","stl"],"created_at":"2024-10-29T23:13:04.585Z","updated_at":"2025-03-26T07:32:12.436Z","avatar_url":"https://github.com/JustasMasiulis.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# circular_buffer\nA simple circular buffer implementation.\nTests and documentation still needs work but I'd say it's working properly and the api is STL style.\n\n## Small example\n```c++\n#include \"circular_buffer.hpp\"\n\n// constructors accept iterators, initializer lists or count + element\njm::circular_buffer\u003cint, 4\u003e cb{ 1,2,3 };\ncb.push_back(4);  // 1234\ncb.push_front(0); // 0123\ncb.push_back(5);  // 1235\ncb.pop_front(); // 235 also supports pop_back\n// iterators are supported and constexpr ( except reverse ones because std::reverse_iterator ) \nfor(auto\u0026 value : cb)\n    std::cout \u003c\u003c value; \ncb.size(); // 3\ncb.max_size() // 4\ncb.clear(); // \n// this can also be done constexpr.\n// using c++14 the only non constexpr api is emplace_back and emplace_front\n```\n\n## How to use\nThe library is a single header so all you need to do is copy the header to your directory and include it.\n\nBy default it uses c++ 11 features. However you can define JM_CIRCULAR_BUFFER_CXX_14 for most of the circular_buffer to become constexpr or JM_CIRCULAR_BUFFER_CXX_OLD for c++98 ( maybe even lower? ) support.\n\nIt is also possible to micro optimize the buffer ( on clang and gcc only ) if you know if it will likely be full or not by using JM_CIRCULAR_BUFFER_LIKELY_FULL OR JM_CIRCULAR_BUFFER_UNLIKELY_FULL.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustasmasiulis%2Fcircular_buffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustasmasiulis%2Fcircular_buffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustasmasiulis%2Fcircular_buffer/lists"}