mcpp index

compat.plf-hive

#include

plf::hive — reference implementation of the proposed std::hive (header-only)

#include <plf_hive.h>
mcpp add compat.plf-hive@2026.07.31

Usage

From this repository's own test project — built and run by CI, not written for the website.

// compat.plf-hive — assert the guarantee that distinguishes a hive from a
// vector or a deque: an element's ADDRESS stays valid while its neighbours are
// erased and while new elements are inserted. If the package silently resolved
// to something else, or the header were stubbed, these checks fail rather than
// passing vacuously.
#include <plf_hive.h>
import std;

int main() {
    bool ok = true;
    auto check = [&](bool cond, std::string_view what) {
        if (!cond) {
            std::println("FAIL: {}", what);
            ok = false;
        }
    };

    plf::hive<int> h;

    // Fill, and remember where a few elements physically live.
    std::vector<plf::hive<int>::iterator> its;
    for (int i = 0; i < 200; ++i) its.push_back(h.insert(i));
// …

tests/examples/plf-hive/tests/hive.cpp · project tests/examples/plf-hive

Build

targets
plf-hive (lib)
language
c++23
C standard
c11
import std
no
include dirs
*

Sources (1)

  • mcpp_generated/plf_hive_anchor.c

Generated files

  • mcpp_generated/plf_hive_anchor.c

Versions

VersionPlatforms Mirrorssha256
2026.07.31 latest LinuxWindowsmacOS GLOBAL CN 507555191c27…