AnySet is a type-erased hash set in the style of std::unordered_set
written in C++17.
In short, you can do neat stuff like this:
using namespace std::literals;
te::AnySet<> set({"Add"s, "a"s, "few"s, "strings"s});
// Or add some ints
set.insert({1, 2, 3, 4});
// Or just whatever
set.insert("Hello"s, 1, 3.1415, std::bitset<3>{0b011u});
// .contains() ...
assert(set.contains("Hello"s));
// With the appropriate includes, you can even print it!
std::cout << set << std::endl;
// prints: {1, 3.1415, Add, 3, a, few, 011, 4, strings, 2, Hello}
See the tutorial page for in-depth usage examples and discussions of AnySet's features.
See the comprehensive documentation for the details AnySet's usage.
AnySet can be installed via the standard git-clone -> CMake -> make -> install procedure:
$ git clone https://github.com/tvanslyke/AnySet.git
$ cd AnySet
$ cmake [options] ./
$ make
$ make install
Installing AnySet requires only CMake and git. Using AnySet in a C++ project requires a C++17-compliant compiler (see Supported Compilers and Standard Libraries).
The tests can be built from the top-level project directory as follows:
$ cmake ./
$ make test-anyset
To run the tests do:
$ ./test/test-anyset
For the latest version of the documentation, see the Documentation section.
AnySet uses Doxygen for its documentation. The docs can be built from the top-level project directory as follows:
$ cmake ./
$ make docs
To view the docs, open the doc/html/index.html
in your favorite web browser, do:
$ <my-favorite-browser> doc/html/index.html
The test suite compiles and passes with the following compilers:
- clang++-5.0 with libstdc++-8 and libc++-7
- clang++-6.0 with libstdc++-8 and libc++-7
- g++-7.3 with libstdc++-7
- g++-8.1 with libstdc++-8
Other versions or combinations of any of the above compilers and STL implementations may work as well, but have not been tested.
Pull requests and bug reports are welcome!
- Timothy VanSlyke - vanslyke.t@husky.neu.edu
This project is licensed under the MIT License.