GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Categories
  • Newsletter
  • Submit
  • Login
  • Awesome C++
  • Containers

This view

  • Original page
  • New address

GeezerVison is showing cpp.libhunt.com — dynamic_bitset Alternatives - C++ Containers | LibHunt

  • Subscribe
  • Submit
  • Categories
  • About
  • Login

dynamic_bitset

Simple Useful Libraries: C++17/20 header-only dynamic bitset

pinam45 logo
pinam45.github.io    Source Code    Docs    Changelog
Suggest Changes
Take the C++ Developer Survey - About 6 minutes on the tools, libraries and AI you use with C++. You get the results by email. Take the survey »
Popularity
2.9
Stable
Activity
6.2
Growing
Stars 182
Watchers 8
Forks 15
Last Commit 2 months ago

Programming language: C++
License: MIT License
Tags: Containers     Header Only     Cross-platform     Library     C++17    
Latest version: v1.3.3

dynamic_bitset alternatives and similar libraries

Based on the "Containers" category.
Alternatively, view dynamic_bitset alternatives based on common mentions on social networks and blogs.

  • pybind11

    9.5 9.1 dynamic_bitset VS pybind11
    Seamless operability between C++11 and Python
    pybind logo
  • PEGTL

    6.6 9.4 dynamic_bitset VS PEGTL
    Parsing Expression Grammar Template Library
    taocpp logo
  • SaaSHub - Software Alternatives and Reviews

    SaaSHub helps you find the best software and product alternatives
    Promo www.saashub.com
    SaaSHub Logo
  • FunctionalPlus

    6.6 5.5 L4 dynamic_bitset VS FunctionalPlus
    Functional Programming Library for C++. Write concise and readable C++ code.
    Dobiasd logo
  • sparsehash

    6.2 0.0 L1 dynamic_bitset VS sparsehash
    C++ associative containers
    sparsehash logo
  • sparsepp

    5.7 3.3 dynamic_bitset VS sparsepp
    A fast, memory efficient hash map for C++
    greg7mdp logo
  • Hopscotch map

    4.8 3.7 L4 dynamic_bitset VS Hopscotch map
    C++ implementation of a fast hash map and hash set using hopscotch hashing
    Tessil logo
  • function2

    4.1 3.3 dynamic_bitset VS function2
    Improved and configurable drop-in replacement to std::function that supports move only types, multiple overloads and more
    Naios logo
  • LSHBOX

    3.8 0.0 L2 dynamic_bitset VS LSHBOX
    A c++ toolbox of locality-sensitive hashing (LSH), provides several popular LSH algorithms, also support python and matlab.
    RSIA-LIESMARS-WHU logo
  • sparsehash-c11

    3.7 0.0 L3 dynamic_bitset VS sparsehash-c11
    Experimental C++11 version of sparsehash
    sparsehash logo
  • Hashmaps

    3.7 0.0 L1 dynamic_bitset VS Hashmaps
    Various open addressing hashmap algorithms in C++
    goossaert logo
  • semver

    3.6 6.9 dynamic_bitset VS semver
    Semantic Versioning for modern C++
    Neargye logo
  • stx-btree

    3.3 0.0 dynamic_bitset VS stx-btree
    OBSOLETE, contained in https://github.com/tlx/tlx - STX B+ Tree C++ Template Classes -
    bingmann logo
  • KOMIHASH

    3.3 4.6 dynamic_bitset VS KOMIHASH
    Very fast, high-quality hash function, discrete-incremental and streamed hashing-capable (non-cryptographic, header-only C/C++) 27GB/s + PRNG
    avaneev logo
  • C++ B-tree

    2.3 0.0 dynamic_bitset VS C++ B-tree
    DISCONTINUED. Git mirror of the official (mercurial) repository of cpp-btree
    algorithm-ninja logo
  • flat_map

    1.8 7.6 dynamic_bitset VS flat_map
    Header only associative linear container.
    Flast logo
  • [Boost.]Multi

    1.6 10.0 dynamic_bitset VS [Boost.]Multi
    Multidimensional arrays for C++. (Not an official Boost library) \\ This is a mirror of gitlab.com/correaa/boost-multi
    correaa logo
  • sqlitemap

    1.3 8.1 dynamic_bitset VS sqlitemap
    sqlitemap is a lightweight C++ wrapper around SQLite that provides a simple, map-like interface.
    bw-hro logo
  • Optional Argument in C++

    1.2 0.0 dynamic_bitset VS Optional Argument in C++
    Named Optional Arguments in C++17
    vincent-picaud logo
  • Learn Project

    1.0 0.0 dynamic_bitset VS Learn Project
    go study
    SAMARITAN2046 logo
  • f-code

    1.0 7.2 dynamic_bitset VS f-code
    DISCONTINUED. a C++ library consisting of basic functionality [GET https://api.github.com/repos/StanislavPetrov15/f-code: 404 - Not Found // See: https://docs.github.com/rest/repos/repos#get-a-repository]
    StanislavPetrov15 logo

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.

Do you think we are missing an alternative of dynamic_bitset or a related project?

Add another 'Containers' Library

Popular Comparisons

  • dynamic_bitset
    vs
    pybind11
  • dynamic_bitset
    vs
    C++ B-tree
  • dynamic_bitset
    vs
    [Boost.]Multi
  • dynamic_bitset
    vs
    Learn Project
  • dynamic_bitset
    vs
    sparsepp

README

dynamic_bitset

Actions Status Actions Status Build Status Build status codecov license

Simple Useful Libraries: The C++17 header-only dynamic bitset

Requirements

To use this dynamic bitset, you will need a C++17 compliant compiler. If you use CMake and want to use the dynamic bitset as a subproject, you will need CMake 3.10 or later.

Usage sample

#include <sul/dynamic_bitset.hpp>
#include <iostream>
#include <random>

int main()
{
    // predefined bitset
    sul::dynamic_bitset<> bitset1(12, 0b0100010110111);
    std::cout << "bitset1     = " << bitset1 << std::endl;

    // random bitset
    std::minstd_rand rand(std::random_device{}());
    std::bernoulli_distribution dist;
    sul::dynamic_bitset<> bitset2;
    for(size_t i = 0; i < 12; ++i)
    {
        bitset2.push_back(dist(rand));
    }
    std::cout << "bitset2     = " << bitset2 << std::endl;

    std::cout << "common bits = " << (bitset1 & bitset2) << std::endl;
    return 0;
}

Possible output:

bitset1     = 100010110111
bitset2     = 001011011011
common bits = 000010010011

Test it on godbolt.org.

Optional dependency

Optionally, libpopcnt will be used optimize the bits counting operations, if the header is available (__has_include(<libpopcnt.h>)) and DYNAMIC_BITSET_NO_LIBPOPCNT is not defined.

Integration

As it is a header-only library, the easiest way to integrate the sul::dynamic_bitset class in your project is to just copy the [sul](include/sul) folder in your project sources. Optionally, if you also copy libpopcnt.h from libpopcnt, it will be used by default if it is available.

CMake integration

If you use CMake and want to use the dynamic bitset as a subproject, clone the repository (or add it as a git submodule) in a sub-folder of your project. Then, in your CMakeLists.txt add:

add_subdirectory(<path_to_dynamic_bitset_folder>)

It will define the dynamic_bitset target and the alias target sul::dynamic_bitset that you can use to add the folder containing dynamic_bitset.hpp to your project header folders. To do so, in your CMakeLists.txt add:

target_link_libraries(<your_project_target> PRIVATE sul::dynamic_bitset)

For example, a simple project with the repository as a git submodule in the extlibs folder, could have a CMakeLists.txt similar to this:

cmake_minimum_required(VERSION 3.10)
project(CoolProject LANGUAGES CXX)

add_executable(CoolProject main.cpp)

add_subdirectory(extlibs/dynamic_bitset)
target_link_libraries(CoolProject PRIVATE sul::dynamic_bitset)

If you pulled the git submodule libpopcnt (in [extlibs](extlibs)) and set the dynamic bitset CMake options DYNAMICBITSET_USE_LIBPOPCNT and DYNAMICBITSET_USE_LIBPOPCNT_SUBMODULE to ON(default values), the folder containing libpopcnt.h will also be added to the headers paths and libpopcnt will be used.

CMake options

Descriptions

  • DYNAMICBITSET_NO_NAMESPACE: Put the dynamic_bitset class in the global namespace instead of the sul namespace (not recommended)
  • DYNAMICBITSET_USE_LIBPOPCNT: Enable using libpopcnt for bits counting operations
  • DYNAMICBITSET_USE_LIBPOPCNT_SUBMODULE: Enable adding libpopcnt submodule to include paths (disable if your project already include libpopcnt)
  • DYNAMICBITSET_BUILD_EXAMPLE: Enable building example for dynamic_bitset
  • DYNAMICBITSET_BUILD_TESTS: Enable building tests for dynamic_bitset
  • DYNAMICBITSET_BUILD_DOCS: Enable building documentation for dynamic_bitset
  • DYNAMICBITSET_FORMAT_TARGET: Enable generating a code formating target for dynamic_bitset
  • DYNAMICBITSET_HEADERS_TARGET_IDE: Enable generating a target with headers for ide for dynamic_bitset

Default values

Option Default value as master project Default value as subdirectory
DYNAMICBITSET_NO_NAMESPACE OFF OFF
DYNAMICBITSET_USE_LIBPOPCNT ON ON
DYNAMICBITSET_USE_LIBPOPCNT_SUBMODULE ON ON
DYNAMICBITSET_BUILD_EXAMPLE ON OFF
DYNAMICBITSET_BUILD_TESTS ON OFF
DYNAMICBITSET_BUILD_DOCS ON OFF
DYNAMICBITSET_FORMAT_TARGET ON OFF
DYNAMICBITSET_HEADERS_TARGET_IDE ON OFF

Build tests, example, and documentation

The latest version of the documentation is available online here.

To build the tests, the example, and the documentation, git submodules are required, so don't forget to pull the submodules with the repository using --recursive:

$ git clone --recursive https://github.com/pinam45/dynamic_bitset.git

or if you have already cloned the repository:

$ git submodule update --init --recursive

The project uses CMake to build and define the options DYNAMICBITSET_BUILD_TESTS, DYNAMICBITSET_BUILD_EXAMPLE, and DYNAMICBITSET_BUILD_DOCS to enable the generation of the tests, example, and documentation targets, these option are enabled by default if the project is the master project (not included from another CMakeLists.txt with add_subdirectory).

Generating the documentation requires Doxygen 1.8.16 or later and is done by building the target dynamic_bitset_docs. For running the tests, build the dynamic_bitset_tests target and launch the tests using ctest.

See Running CMake and the ctest documentation for more information. On linux, a common way of doing this is:

$ mkdir cmake-build
$ cd cmake-build
$ cmake ..
$ cmake --build .
$ ctest

On Windows, there is batch files available to configure a Visual Studio project in the [ide](ide) folder.

License

dynamic_bitset is licensed under the MIT License:

Copyright © 2019 Maxime Pinard

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


*Note that all licence references and agreements mentioned in the dynamic_bitset README section above are relevant to that project's source code only.

Do not miss the trending, libraries, news and articles with our weekly report.

Awesome C++ is part of the LibHunt network. Terms. Privacy Policy.

(CC)
BY-SA
Spin The Wheel Of Names for a cryptographically secure random name picker.
Schedule a when to meet poll.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.