{"id":16833054,"url":"https://github.com/mariokonrad/bitset","last_synced_at":"2026-06-11T16:31:05.952Z","repository":{"id":6433769,"uuid":"7672451","full_name":"mariokonrad/bitset","owner":"mariokonrad","description":null,"archived":false,"fork":false,"pushed_at":"2021-08-25T16:59:23.000Z","size":377,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-18T19:51:58.820Z","etag":null,"topics":["c-plus-plus","cpp11"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mariokonrad.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":"2013-01-17T19:16:19.000Z","updated_at":"2025-02-19T20:49:48.000Z","dependencies_parsed_at":"2022-09-12T00:21:01.200Z","dependency_job_id":null,"html_url":"https://github.com/mariokonrad/bitset","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mariokonrad/bitset","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariokonrad%2Fbitset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariokonrad%2Fbitset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariokonrad%2Fbitset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariokonrad%2Fbitset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mariokonrad","download_url":"https://codeload.github.com/mariokonrad/bitset/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariokonrad%2Fbitset/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34208761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["c-plus-plus","cpp11"],"created_at":"2024-10-13T11:51:14.444Z","updated_at":"2026-06-11T16:31:05.933Z","avatar_url":"https://github.com/mariokonrad.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"bitset\n======\n\nThis is a dynamic bitset, supporting various operations.\n\n\nSupported Operations\n--------------------\n\nContainer operations:\n\n    // tells the capacity of the current bitset in bits\n    size_type capacity() const noexcept;\n\n    // tells the current size of the bitset in bits\n    size_type size() const noexcept;\n\n    // reserves number of blocks\n    void reserve(size_type blocks);\n\n    // clears all bits from the bitset\n    void clear();\n\n\nIterator operations:\n\n\t// const iterator\n    const_iterator begin() const;\n    const_iterator end() const;\n    const_iterator cbegin() const;\n    const_iterator cend() const;\n\n\nAppend to the bitset:\n\n    // appends another bitset\n    template \u003cclass U\u003e\n    void append(const bitset\u003cU\u003e \u0026 other);\n\n    // appends a number of bits to the bitset\n    template \u003cclass T\u003e\n    void append(T value, size_type bits);\n\n\nRandom access write:\n\n    // sets another bitset at the specific position\n    template \u003cclass U\u003e\n    void set(const bitset\u003cU\u003e \u0026 bs, size_type ofs);\n\n    // sets a number of bits from the specified value at the specified position\n    template \u003ctypename T\u003e\n    void set(T v, size_type ofs, size_type bits);\n\n    // resets a bit at the specified position\n    void reset(size_type index);\n\n    // resets the entire bitset\n    void reset() noexcept;\n\n    // sets a bit value at the speicifed position\n    void set_bit(size_type i, bool value)\n\n\nRandom access read:\n\n    // reads a bit value at the specified position\n    bool get_bit(size_type i) const\n\n    // reads a bit value at the specified position\n    bool test(size_type i) const;\n\n    // returns the value at the specified position using the specified number of bits.\n    // T must be an integral or enum type.\n    template \u003cclass T\u003e\n    T get(size_type ofs, size_type bits) const;\n\n    // reads into the value from the specified position using specified number of bits.\n    template \u003cclass T\u003e\n    void get(T \u0026 value, size_type ofs, size_type bits) const;\n\n    // returns the bit value at the specified position.\n    bool operator[](size_type i) const;\n\n\nComparison:\n\n    // comparison for equal and inequal. works with bitsets of different block type as well.\n    bool operator==(const bitset \u0026 other) const;\n    bool operator!=(const bitset \u0026 other) const;\n\n    // comparison for less, less or equal, greater, greater or equal.\n    bool operator\u003c(const bitset \u0026 other) const;\n    bool operator\u003c=(const bitset \u0026 other) const;\n    bool operator\u003e(const bitset \u0026 other) const;\n    bool operator\u003e=(const bitset \u0026 other) const;\n\n\nArithmetic operations:\n\n    // increment\n    bitset \u0026 operator++();\n    bitset operator++(int);\n\n    // decrement\n    bitset \u0026 operator--();\n    bitset operator--(int);\n\n\nBit shift:\n\n    // shift left number of bits\n    bitset \u0026 shl(size_type bits);\n    bitset \u0026 operator\u003c\u003c=(size_type bits);\n    bitset operator\u003c\u003c(size_type bits) const;\n\n    // shift right number of bits\n    bitset \u0026 shr(size_type bits);\n    bitset \u0026 operator\u003e\u003e=(size_type bits);\n    bitset operator\u003e\u003e(size_type bits) const;\n\n\nLogic operations:\n\n    // logical or\n    bitset \u0026 operator|=(const bitset \u0026 other);\n    bitset operator|(const bitset \u0026 other) const;\n\n    // logical and\n    bitset \u0026 operator\u0026=(const bitset \u0026 other);\n    bitset operator\u0026(const bitset \u0026 other) const;\n\n    // logical xor\n    bitset \u0026 operator^=(const bitset \u0026 other);\n    bitset operator^(const bitset \u0026 other) const;\n\n\nOther functions:\n\n    // flips a bit at the specified position.\n    void flip(size_type i);\n\n    // returns true if all bits are set.\n    bool all() const noexcept;\n\n    // returns true if any bits are set, overall or within the range.\n    bool any() const noexcept;\n    bool any(const_iterator first, const_iterator last) const noexcept;\n\n    // returns true if no bits are set, overall or within the range.\n    bool none() const noexcept;\n    bool none(const_iterator first, const_iterator last) const noexcept;\n\n    // returns the number of bits set, overall or within the range.\n    size_type count() const noexcept;\n    size_type count(const_iterator first, const_iterator last) const noexcept;\n\n\nLICENSE\n=======\n\nSee LICENSE\n\nStatus\n======\n\n[![Build Status](https://travis-ci.org/mariokonrad/bitset.svg?branch=master)](https://travis-ci.org/mariokonrad/bitset)\n\nBuild\n=====\n\nThe source is completely as header file. If you like to build examples\nand unit tests:\n~~~~~~~~~~\n\tmake\n~~~~~~~~~~\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariokonrad%2Fbitset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmariokonrad%2Fbitset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariokonrad%2Fbitset/lists"}