Skip to content

A simplified implementation of absl::flat_hash_set.

License

Notifications You must be signed in to change notification settings

cvarad/swiss_table_set

Repository files navigation

Swiss Table Set

This is my simplified implementation of absl::flat_hash_set.

Usage

Just copy over hash.h and swiss_table.h to your directory and import swiss_table.h in your code.
Build your code with the -std=c++2a flag.
Example usage:

#include "swiss_table.h"
#include <iostream>

using namespace std;

int main() {
    sst::swiss_table_set<int> my_set;

    my_set.insert(5);
    my_set.insert(10);
    my_set.erase(10);

    auto it = my_set.find(10);

    if (it == my_set.end())
        cout << "Not found" << endl;

    return 0;
}

Tests

I have created a simple benchmarking test for this project. The test code will work only with g++. For some reason, clang++ fails to recognize the templates.
To build and run the tests:

make build_test
make run_test

About

A simplified implementation of absl::flat_hash_set.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published