compat.robin-map
#includeA C++ implementation of a fast hash map and hash set using robin hood hashing
#include <tsl/robin_map.h>
mcpp add compat.robin-map@1.4.1
用法
來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。
// compat.robin-map — exercise the two containers the package exists for:
// tsl::robin_map and tsl::robin_set. The checks assert observable behaviour
// (lookup, iteration, erasure, rehashing), not merely that the headers compile.
#include <tsl/robin_map.h>
#include <tsl/robin_set.h>
#include <cstdio>
#include <string>
#include <vector>
int main() {
bool ok = true;
auto check = [&](bool cond, const char* what) {
if (!cond) {
std::fprintf(stderr, "FAIL: %s\n", what);
ok = false;
}
};
// ---- robin_map -------------------------------------------------------
tsl::robin_map<std::string, int> map;
for (int i = 0; i < 1000; ++i) map.emplace("k" + std::to_string(i), i);
// …
tests/examples/robin-map/tests/smoke.cpp · 專案 tests/examples/robin-map
建置
- targets
robin-map (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
*/include
原始檔 (1)
mcpp_generated/robin_map_anchor.c
產生的檔案
mcpp_generated/robin_map_anchor.c