<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/c-26-std-hive-umqdxdqhq" -->

---
title: C++26: std::hive | daily.dev
description: C++26 introduces std::hive, a new container available via the &lt;hive&gt; header (from P0447R28), derived from the long-standing plf::colony library. It offers...
canonical: https://daily.dev/posts/c-26-std-hive-umqdxdqhq
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: C++26: std::hive | daily.dev
og:description: C++26 introduces std::hive, a new container available via the &lt;hive&gt; header (from P0447R28), derived from the long-standing plf::colony library. It offers...
og:url: https://daily.dev/posts/c-26-std-hive-umqdxdqhq
og:image: https://api.daily.dev/og/posts/UmQdxdqhq.png
og:image:alt: C++26: std::hive
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# C++26: std::hive

**[Sandor Dargo](https://daily.dev/sources/sandordargo)** · 6 min read · 2 upvotes · 0 comments

## Summary

C++26 introduces std::hive, a new container available via the <hive> header (from P0447R28), derived from the long-standing plf::colony library. It offers stable pointers and iterators across insertions and erasures, O(1) amortized insert/erase, and good cache locality via multiple contiguous memory blocks with a run-length-encoded skipfield to skip erased slots. Unlike std::vector or std::list, it has no random access, no push_back/push_front, and unspecified insertion order. It also supports block capacity tuning and hive-specific operations like sort(), splice(), and get_iterator(). It's aimed at use cases like game entities, event subscribers, and connection pools where cross-references must survive mutation.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.sandordargo.com/blog/2026/09/02/cpp26-hive>

## Questions this post answers

### What is std::hive in C++26 and what problem does it solve?

std::hive is a new C++26 standard library container, defined in the <hive> header via proposal P0447R28, that provides pointer and iterator stability across insertions and erasures while keeping O(1) amortized insert and erase performance and good cache locality. It stores elements across multiple independently allocated memory blocks with a skipfield tracking erased slots, making it ideal for game entities, event subscribers, or connection pools that hold cross-references.

_Developers tracking new C++26 containers like std::hive can follow practical breakdowns on daily.dev._

### Is std::hive the same as plf::colony?

Yes, std::hive is the standardized version of the plf::colony library, renamed during the C++ standardization process after 28 revisions and eight years of committee work under proposal P0447R28. The core design, including multiple memory blocks, a skipfield for skipping erased slots, and erased-slot reuse, carried over from plf::colony into the new standard container.

_Anyone migrating from plf::colony to std::hive can find migration context like this on daily.dev._

### How does std::hive compare to std::vector and std::list for erasing elements?

Erasing from the middle is O(n) for std::vector, O(1) for std::list, and O(1) amortized for std::hive. Std::hive also matches std::list on pointer stability during erase (both preserve pointers, unlike vector) while offering better cache locality than std::list thanks to contiguous memory blocks, though it lacks random access and does not preserve insertion order the way vector and list do.

_Developers choosing between vector, list, and hive for cross-referenced data can compare trade-offs on daily.dev._

## Similar posts on daily.dev

- [C\+\+26: std::indirect](https://daily.dev/posts/c-26-std-indirect-rwwdwxrjf) · Sandor Dargo · 0 upvotes · 0 comments
- [Part 1: std::inplace\_vector — The Fixed-Capacity Vector Finally Comes to C\+\+26](https://daily.dev/posts/part-1-std-inplace-vector-the-fixed-capacity-vector-finally-comes-to-c-26-obybukog4) · Towards Dev · 0 upvotes · 0 comments
- [C\+\+17 STL Cookbook](https://daily.dev/posts/c-17-stl-cookbook-11z3zveyx) · Jacek Galowicz · 1 upvotes · 0 comments
- [C\+\+26: std::polymorphic](https://daily.dev/posts/c-26-std-polymorphic-zsy0pbvxy) · Sandor Dargo · 1 upvotes · 0 comments

---

Tags: [#c++](https://daily.dev/tags/c++), [#data-structures](https://daily.dev/tags/data-structures)

[View this post on daily.dev](https://daily.dev/posts/c-26-std-hive-umqdxdqhq)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"C++26: std::hive","url":"https://daily.dev/posts/c-26-std-hive-umqdxdqhq","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/c-26-std-hive-umqdxdqhq"},"datePublished":"2026-09-02T05:35:21.870Z","dateModified":"2026-09-14T08:08:56.821Z","description":"C++26 introduces std::hive, a new container available via the <hive> header (from P0447R28), derived from the long-standing plf::colony library. It offers...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bc56fe31dfb8fc6b112ce220016c1fe6?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bc56fe31dfb8fc6b112ce220016c1fe6?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Sandor Dargo","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Sandor Dargo","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/48d17993e5864d66951193405fa786bb","url":"https://daily.dev/sources/sandordargo"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/c-26-std-hive-umqdxdqhq","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"c++,data-structures","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sandor Dargo","item":"https://daily.dev/sources/sandordargo"},{"@type":"ListItem","position":3,"name":"C++26: std::hive"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/c-26-std-hive-umqdxdqhq#faq","mainEntity":[{"@type":"Question","name":"What is std::hive in C++26 and what problem does it solve?","acceptedAnswer":{"@type":"Answer","text":"std::hive is a new C++26 standard library container, defined in the <hive> header via proposal P0447R28, that provides pointer and iterator stability across insertions and erasures while keeping O(1) amortized insert and erase performance and good cache locality. It stores elements across multiple independently allocated memory blocks with a skipfield tracking erased slots, making it ideal for game entities, event subscribers, or connection pools that hold cross-references. Developers tracking new C++26 containers like std::hive can follow practical breakdowns on daily.dev."}},{"@type":"Question","name":"Is std::hive the same as plf::colony?","acceptedAnswer":{"@type":"Answer","text":"Yes, std::hive is the standardized version of the plf::colony library, renamed during the C++ standardization process after 28 revisions and eight years of committee work under proposal P0447R28. The core design, including multiple memory blocks, a skipfield for skipping erased slots, and erased-slot reuse, carried over from plf::colony into the new standard container. Anyone migrating from plf::colony to std::hive can find migration context like this on daily.dev."}},{"@type":"Question","name":"How does std::hive compare to std::vector and std::list for erasing elements?","acceptedAnswer":{"@type":"Answer","text":"Erasing from the middle is O(n) for std::vector, O(1) for std::list, and O(1) amortized for std::hive. Std::hive also matches std::list on pointer stability during erase (both preserve pointers, unlike vector) while offering better cache locality than std::list thanks to contiguous memory blocks, though it lacks random access and does not preserve insertion order the way vector and list do. Developers choosing between vector, list, and hive for cross-referenced data can compare trade-offs on daily.dev."}}]}
```

