-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from martinus/2022-08-custom-bucket-types
2022 08 custom bucket types
- Loading branch information
Showing
5 changed files
with
135 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include <ankerl/unordered_dense.h> | ||
|
||
#include <doctest.h> | ||
|
||
#include <limits> | ||
#include <stdexcept> // for out_of_range | ||
|
||
using Map = ankerl::unordered_dense::map<std::string, size_t>; | ||
|
||
// big bucket type allows 2^64 elements, but has more memory & CPU overhead. | ||
using MapBig = ankerl::unordered_dense::map<std::string, | ||
size_t, | ||
ankerl::unordered_dense::hash<std::string>, | ||
std::equal_to<std::string>, | ||
std::allocator<std::pair<std::string, size_t>>, | ||
ankerl::unordered_dense::bucket_type::big>; | ||
|
||
static_assert(sizeof(Map::bucket_type) == 8U); | ||
static_assert(sizeof(MapBig::bucket_type) == sizeof(size_t) + 4U); | ||
|
||
static_assert(Map::max_size() == std::numeric_limits<uint32_t>::max()); | ||
static_assert(MapBig::max_size() == std::numeric_limits<size_t>::max()); | ||
|
||
static_assert(Map::max_bucket_count() == std::numeric_limits<uint32_t>::max()); | ||
static_assert(MapBig::max_bucket_count() == std::numeric_limits<size_t>::max()); | ||
|
||
TEST_CASE("bucket") { | ||
// TODO nothing here yet | ||
} |
Oops, something went wrong.