<!-- 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, available in the <hive> header via proposal P0447R28, that provides stable pointers and iterators surviving insertions and erasures, O(1) amortized insert/erase, and good cache locality through multiple contiguous memory blocks. It solves the problem of needing both pointer stability (like std::list) and cache-friendly contiguous storage (like std::vector), useful for game entities, event subscribers, and connection pools with cross-references.

_daily.dev surfaces standard library additions like std::hive for developers evaluating container choices._

### Where did std::hive come from and why is it not called colony?

std::hive originated from the plf::colony library and was renamed after 28 revisions and eight years of committee work before being standardized in C++26 as std::hive. The design retains colony's core ideas: multiple independently allocated memory blocks, a run-length-encoded skipfield for O(1) iteration past erased elements, and reuse of erased slots for new insertions.

_Track how community libraries evolve into standard features by following C++ proposal history 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. Pointer stability on erase is not preserved by std::vector but is preserved by both std::list and std::hive. Cache locality is excellent for std::vector, poor for std::list, and good for std::hive due to its contiguous memory blocks; unlike the other two, std::hive has unspecified insertion order and no random access.

_Compare container trade-offs like these on daily.dev before picking a data structure for performance-critical code._

## Similar posts on daily.dev

- [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\+\+26: std::indirect](https://daily.dev/posts/c-26-std-indirect-rwwdwxrjf) · Sandor Dargo · 0 upvotes · 0 comments
- [C\+\+26: std::inplace\_vector](https://daily.dev/posts/c-26-std-inplace-vector-9a9stjxez) · Sandor Dargo · 2 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-02T05:35:45.137Z","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, available in the <hive> header via proposal P0447R28, that provides stable pointers and iterators surviving insertions and erasures, O(1) amortized insert/erase, and good cache locality through multiple contiguous memory blocks. It solves the problem of needing both pointer stability (like std::list) and cache-friendly contiguous storage (like std::vector), useful for game entities, event subscribers, and connection pools with cross-references. daily.dev surfaces standard library additions like std::hive for developers evaluating container choices."}},{"@type":"Question","name":"Where did std::hive come from and why is it not called colony?","acceptedAnswer":{"@type":"Answer","text":"std::hive originated from the plf::colony library and was renamed after 28 revisions and eight years of committee work before being standardized in C++26 as std::hive. The design retains colony's core ideas: multiple independently allocated memory blocks, a run-length-encoded skipfield for O(1) iteration past erased elements, and reuse of erased slots for new insertions. Track how community libraries evolve into standard features by following C++ proposal history 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. Pointer stability on erase is not preserved by std::vector but is preserved by both std::list and std::hive. Cache locality is excellent for std::vector, poor for std::list, and good for std::hive due to its contiguous memory blocks; unlike the other two, std::hive has unspecified insertion order and no random access. Compare container trade-offs like these on daily.dev before picking a data structure for performance-critical code."}}]}
```

