mcpp index

compat.robin-map

#include

A 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

版本

版本平台 镜像sha256
1.4.1 最新 LinuxWindowsmacOS CN GLOBAL 0e3f53a377fd…