Skip to content

n0a0v/sh-flat

Repository files navigation

See LICENSE for copyright details.

This implementation requires a C++17 compliant compiler and has been tested
with:
	* g++ 13
	* clang 18
	* MSVC 2022 (17.14.29)

CMake & binaries are setup for unit testing and benchmarking. Only the headers
in the "sh" directory are necessary to use the various flat map & set
implementations. Simply move them as a group to a desired directory.

sh::flat_map:
	* Like C++23's std::flat_map.
sh::adjacent_flat_map:
	* Similar to C++23's std::flat_map, but uses values stored in std::pair (or
	  similar) in a single container.
sh::flat_set:
	* Like C++23's std::flat_set.
sh::unordered_flat_map:
	* Similar to C++23's std::flat_map but without the guaranteed ordering.
	* Doesn't use binary search.
	* Uses an std::equal_to-like comparator instead of std::less-like.
sh::unordered_adjacent_flat_map:
	* Similar to C++23's std::flat_map but without the guaranteed ordering and
	  uses values stored in std::pair (or similar) in a single container.
	* Like sh::unordered_flat_map, doesn't use binary search.
	* Like sh::unordered_flat_map, uses an std::equal_to-like comparator
	  instead of std::less-like.
sh::unordered_flat_set:
	* Similar to C++23's std::flat_set but without the guaranteed ordering.
	* Doesn't use binary search.
	* Uses an std::equal_to-like comparator instead of std::less-like.

I hope this is useful or at least interesting!

About

C++23 flat_map, flat_set, and unordered variants for C++17.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages