Please check out the library's documentation to learn more.
Boost.Unordered offers a catalog of hash containers with different standards compliance levels, performances and intented usage scenarios:
boost::unordered_set boost::unordered_map boost::unordered_multiset boost::unordered_multimap
std::unordered_[multi](set|map),
but faster and up to the latest revisions of the standard even if you're working in an older version of C++ (heterogeneous lookup,
try_emplace, contains, etc.)boost::unordered_flat_set boost::unordered_flat_map
boost::unordered_node_set boost::unordered_node_map
boost::unordered_flat_(set|map) providing pointer stability.boost::concurrent_flat_set boost::concurrent_flat_map
boost::concurrent_node_set boost::concurrent_node_map
boost::concurrent_flat_(set|map) providing pointer stability.Boost.Unordered can be installed in a number of ways:
conanfile.txt (the example requires at least Boost 1.86):[requires]
boost/[>=1.86.0]
[options]
boost:header_only=True
vcpkg install boost-unordered
[unordered] tag at the beginning of the subject line)<h1>Boost.Unordered</h1> <p><a href="https://github.com/boostorg/unordered/tree/master"><img src="https://img.shields.io/badge/branch-master-brightgreen.svg" alt="Branch" /></a> <a href="https://github.com/boostorg/unordered/actions/workflows/ci.yml"><img src="https://github.com/boostorg/unordered/actions/workflows/ci.yml/badge.svg?branch=master" alt="CI" /></a> <a href="https://drone.cpp.al/boostorg/unordered"><img src="https://img.shields.io/drone/build/boostorg/unordered/master?server=https%3A%2F%2Fdrone.cpp.al&logo=drone&logoColor=%23CCCCCC&label=CI" alt="Drone status" /></a> <a href="https://ci.appveyor.com/project/cppalliance/unordered/branch/master"><img src="https://img.shields.io/appveyor/build/cppalliance/unordered/master?logo=appveyor&label=CI" alt="Build status" /></a> <a href="https://codecov.io/gh/boostorg/unordered/branch/master"><img src="https://codecov.io/gh/boostorg/unordered/branch/master/graph/badge.svg" alt="codecov" /></a> <a href="https://pdimov.github.io/boostdep-report/master/unordered.html"><img src="https://img.shields.io/badge/deps-master-brightgreen.svg" alt="Deps" /></a> <a href="https://www.boost.org/doc/libs/master/libs/unordered/index.html"><img src="https://img.shields.io/badge/docs-master-brightgreen.svg" alt="Documentation" /></a> <a href="http://www.boost.org/development/tests/master/developer/unordered.html"><img src="https://img.shields.io/badge/matrix-master-brightgreen.svg" alt="Enter the Matrix" /></a><br/> <a href="https://github.com/boostorg/unordered/tree/develop"><img src="https://img.shields.io/badge/branch-develop-brightgreen.svg" alt="Branch" /></a> <a href="https://github.com/boostorg/unordered/actions/workflows/ci.yml"><img src="https://github.com/boostorg/unordered/actions/workflows/ci.yml/badge.svg?branch=develop" alt="CI" /></a> <a href="https://drone.cpp.al/boostorg/unordered"><img src="https://img.shields.io/drone/build/boostorg/unordered/develop?server=https%3A%2F%2Fdrone.cpp.al&logo=drone&logoColor=%23CCCCCC&label=CI" alt="Drone status" /></a> <a href="https://ci.appveyor.com/project/cppalliance/unordered/branch/develop"><img src="https://img.shields.io/appveyor/build/cppalliance/unordered/develop?logo=appveyor&label=CI" alt="Build status" /></a> <a href="https://codecov.io/gh/boostorg/unordered/branch/develop"><img src="https://codecov.io/gh/boostorg/unordered/branch/develop/graph/badge.svg" alt="codecov" /></a> <a href="https://pdimov.github.io/boostdep-report/develop/unordered.html"><img src="https://img.shields.io/badge/deps-develop-brightgreen.svg" alt="Deps" /></a> <a href="https://www.boost.org/doc/libs/develop/libs/unordered/index.html"><img src="https://img.shields.io/badge/docs-develop-brightgreen.svg" alt="Documentation" /></a> <a href="http://www.boost.org/development/tests/develop/developer/unordered.html"><img src="https://img.shields.io/badge/matrix-develop-brightgreen.svg" alt="Enter the Matrix" /></a><br/> <a href="https://www.boost.org/users/license.html"><img src="https://img.shields.io/badge/license-BSL_1.0-blue.svg" alt="BSL 1.0" /></a> <img alt="C++11 required" src="https://img.shields.io/badge/standard-C%2b%2b11-blue.svg"> <img alt="Header-only library" src="https://img.shields.io/badge/build-header--only-blue.svg"></p> <p>Boost.Unordered offers a catalog of hash containers with different standards compliance levels, performances and intented usage scenarios:</p> <p><strong><code>boost::unordered_set</code> <code>boost::unordered_map</code> <code>boost::unordered_multiset</code> <code>boost::unordered_multimap</code></strong></p> <ul>Fully conformant implementations of <code>std::unordered_[multi](set|map)</code>, but faster and up to the latest revisions of the standard even if you're working in an older version of C++ (heterogeneous lookup, <code>try_emplace</code>, <code>contains</code>, etc.)</ul> <p><strong><code>boost::unordered_flat_set</code> <code>boost::unordered_flat_map</code></strong></p> <ul>The fastest of the lot. Based on open addressing, these containers slightly deviate from the standard in exchange for top performance.</ul> <p><strong><code>boost::unordered_node_set</code> <code>boost::unordered_node_map</code></strong></p> <ul>Variations of <code>boost::unordered_flat_(set|map)</code> providing pointer stability.</ul> <p><strong><code>boost::concurrent_flat_set</code> <code>boost::concurrent_flat_map</code></strong></p> <ul>High performance for multithreaded scenarios. Introducing a new non-standard, iterator-free API.</ul> <p><strong><code>boost::concurrent_node_set</code> <code>boost::concurrent_node_map</code></strong></p> <ul>Variations of <code>boost::concurrent_flat_(set|map)</code> providing pointer stability.</ul> <h2>Learn about Boost.Unordered</h2> <ul> <li><a href="https://boost.org/libs/unordered">Online documentation</a></li> <li><a href="https://github.com/boostorg/boost_unordered_benchmarks">Some benchmarks</a></li> <li>Technical articles on Boost.Unordered internal design: <ul> <li><a href="https://bannalia.blogspot.com/2022/06/advancing-state-of-art-for.html">Advancing the state of the art for <code>std::unordered_map</code> implementations</a></li> <li><a href="https://bannalia.blogspot.com/2022/11/inside-boostunorderedflatmap.html">Inside <code>boost::unordered_flat_map</code></a></li> <li><a href="https://bannalia.blogspot.com/2023/07/inside-boostconcurrentflatmap.html">Inside <code>boost::concurrent_flat_map</code></a></li> <li><a href="https://bannalia.blogspot.com/2023/10/bulk-visitation-in-boostconcurrentflatm.html">Bulk visitation in <code>boost::concurrent_flat_map</code></a></li> </ul> </li> <li>Debugging visualizers for Boost.Unordered: <ul> <li><a href="https://blog.ganets.ky/NatvisForUnordered/">Natvis for boost::unordered_map, and how to use <Intrinsic> elements</a></li> <li><a href="https://blog.ganets.ky/NatvisForUnordered2/">Natvis for boost::concurrent_flat_map, and why fancy pointers are hard</a></li> <li><a href="https://blog.ganets.ky/PrettyPrinter/">Visualizing boost::unordered_map in GDB, with pretty-printer customization points</a></li> </ul> </li> </ul> <p>Boost.Unordered can be installed in a number of ways:</p> <ul> <li><a href="https://www.boost.org/users/download/">Download Boost</a> and you're ready to go (this is a header-only library requiring no building).</li> <li>Using Conan 2: In case you don't have it yet, add an entry for Boost in your <code>conanfile.txt</code> (the example requires at least Boost 1.86):</li> </ul> <pre class="highlightjs highlight"><code class="language- hljs">[requires] boost/[>=1.86.0] </code></pre> <ul>If you're not using any compiled Boost library, the following will skip building altogether:</ul> <pre class="highlightjs highlight"><code class="language- hljs">[options] boost:header_only=True </code></pre> <ul> <li>Using vcpkg: Execute the command</li> </ul> <pre class="highlightjs highlight"><code class="language- hljs">vcpkg install boost-unordered </code></pre> <ul> <li>Using CMake: <a href="https://github.com/boostorg/cmake">Boost CMake support infrastructure</a> allows you to use CMake directly to download, build and consume all of Boost or some specific libraries.</li> </ul> <h2>Support</h2> <ul> <li>Join the <strong>#boost-unordered</strong> discussion group at <a href="https://cpplang.slack.com/">cpplang.slack.com</a> (<a href="https://cppalliance.org/slack/">ask for an invite</a> if you’re not a member of this workspace yet)</li> <li>Ask in the <a href="https://lists.boost.org/mailman/listinfo.cgi/boost-users">Boost Users mailing list</a> (add the <code>[unordered]</code> tag at the beginning of the subject line)</li> <li><a href="https://github.com/boostorg/unordered/issues">File an issue</a></li> </ul> <h2>Contribute</h2> <ul> <li><a href="https://github.com/boostorg/unordered/pulls">Pull requests</a> against <strong>develop</strong> branch are most welcome. Note that by submitting patches you agree to license your modifications under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</li> </ul>
<h1>Boost.Unordered</h1> <p><a href="https://github.com/boostorg/unordered/tree/master"><img src="https://img.shields.io/badge/branch-master-brightgreen.svg" alt="Branch" /></a> <a href="https://github.com/boostorg/unordered/actions/workflows/ci.yml"><img src="https://github.com/boostorg/unordered/actions/workflows/ci.yml/badge.svg?branch=master" alt="CI" /></a> <a href="https://drone.cpp.al/boostorg/unordered"><img src="https://img.shields.io/drone/build/boostorg/unordered/master?server=https%3A%2F%2Fdrone.cpp.al&logo=drone&logoColor=%23CCCCCC&label=CI" alt="Drone status" /></a> <a href="https://ci.appveyor.com/project/cppalliance/unordered/branch/master"><img src="https://img.shields.io/appveyor/build/cppalliance/unordered/master?logo=appveyor&label=CI" alt="Build status" /></a> <a href="https://codecov.io/gh/boostorg/unordered/branch/master"><img src="https://codecov.io/gh/boostorg/unordered/branch/master/graph/badge.svg" alt="codecov" /></a> <a href="https://pdimov.github.io/boostdep-report/master/unordered.html"><img src="https://img.shields.io/badge/deps-master-brightgreen.svg" alt="Deps" /></a> <a href="https://www.boost.org/doc/libs/master/libs/unordered/index.html"><img src="https://img.shields.io/badge/docs-master-brightgreen.svg" alt="Documentation" /></a> <a href="http://www.boost.org/development/tests/master/developer/unordered.html"><img src="https://img.shields.io/badge/matrix-master-brightgreen.svg" alt="Enter the Matrix" /></a><br/> <a href="https://github.com/boostorg/unordered/tree/develop"><img src="https://img.shields.io/badge/branch-develop-brightgreen.svg" alt="Branch" /></a> <a href="https://github.com/boostorg/unordered/actions/workflows/ci.yml"><img src="https://github.com/boostorg/unordered/actions/workflows/ci.yml/badge.svg?branch=develop" alt="CI" /></a> <a href="https://drone.cpp.al/boostorg/unordered"><img src="https://img.shields.io/drone/build/boostorg/unordered/develop?server=https%3A%2F%2Fdrone.cpp.al&logo=drone&logoColor=%23CCCCCC&label=CI" alt="Drone status" /></a> <a href="https://ci.appveyor.com/project/cppalliance/unordered/branch/develop"><img src="https://img.shields.io/appveyor/build/cppalliance/unordered/develop?logo=appveyor&label=CI" alt="Build status" /></a> <a href="https://codecov.io/gh/boostorg/unordered/branch/develop"><img src="https://codecov.io/gh/boostorg/unordered/branch/develop/graph/badge.svg" alt="codecov" /></a> <a href="https://pdimov.github.io/boostdep-report/develop/unordered.html"><img src="https://img.shields.io/badge/deps-develop-brightgreen.svg" alt="Deps" /></a> <a href="https://www.boost.org/doc/libs/develop/libs/unordered/index.html"><img src="https://img.shields.io/badge/docs-develop-brightgreen.svg" alt="Documentation" /></a> <a href="http://www.boost.org/development/tests/develop/developer/unordered.html"><img src="https://img.shields.io/badge/matrix-develop-brightgreen.svg" alt="Enter the Matrix" /></a><br/> <a href="https://www.boost.org/users/license.html"><img src="https://img.shields.io/badge/license-BSL_1.0-blue.svg" alt="BSL 1.0" /></a> <img alt="C++11 required" src="https://img.shields.io/badge/standard-C%2b%2b11-blue.svg"> <img alt="Header-only library" src="https://img.shields.io/badge/build-header--only-blue.svg"></p> <p>Boost.Unordered offers a catalog of hash containers with different standards compliance levels, performances and intented usage scenarios:</p> <p><strong><code>boost::unordered_set</code> <code>boost::unordered_map</code> <code>boost::unordered_multiset</code> <code>boost::unordered_multimap</code></strong></p> <ul>Fully conformant implementations of <code>std::unordered_[multi](set|map)</code>, but faster and up to the latest revisions of the standard even if you're working in an older version of C++ (heterogeneous lookup, <code>try_emplace</code>, <code>contains</code>, etc.)</ul> <p><strong><code>boost::unordered_flat_set</code> <code>boost::unordered_flat_map</code></strong></p> <ul>The fastest of the lot. Based on open addressing, these containers slightly deviate from the standard in exchange for top performance.</ul> <p><strong><code>boost::unordered_node_set</code> <code>boost::unordered_node_map</code></strong></p> <ul>Variations of <code>boost::unordered_flat_(set|map)</code> providing pointer stability.</ul> <p><strong><code>boost::concurrent_flat_set</code> <code>boost::concurrent_flat_map</code></strong></p> <ul>High performance for multithreaded scenarios. Introducing a new non-standard, iterator-free API.</ul> <p><strong><code>boost::concurrent_node_set</code> <code>boost::concurrent_node_map</code></strong></p> <ul>Variations of <code>boost::concurrent_flat_(set|map)</code> providing pointer stability.</ul> <h2>Learn about Boost.Unordered</h2> <ul> <li><a href="https://boost.org/libs/unordered">Online documentation</a></li> <li><a href="https://github.com/boostorg/boost_unordered_benchmarks">Some benchmarks</a></li> <li>Technical articles on Boost.Unordered internal design: <ul> <li><a href="https://bannalia.blogspot.com/2022/06/advancing-state-of-art-for.html">Advancing the state of the art for <code>std::unordered_map</code> implementations</a></li> <li><a href="https://bannalia.blogspot.com/2022/11/inside-boostunorderedflatmap.html">Inside <code>boost::unordered_flat_map</code></a></li> <li><a href="https://bannalia.blogspot.com/2023/07/inside-boostconcurrentflatmap.html">Inside <code>boost::concurrent_flat_map</code></a></li> <li><a href="https://bannalia.blogspot.com/2023/10/bulk-visitation-in-boostconcurrentflatm.html">Bulk visitation in <code>boost::concurrent_flat_map</code></a></li> </ul> </li> <li>Debugging visualizers for Boost.Unordered: <ul> <li><a href="https://blog.ganets.ky/NatvisForUnordered/">Natvis for boost::unordered_map, and how to use <Intrinsic> elements</a></li> <li><a href="https://blog.ganets.ky/NatvisForUnordered2/">Natvis for boost::concurrent_flat_map, and why fancy pointers are hard</a></li> <li><a href="https://blog.ganets.ky/PrettyPrinter/">Visualizing boost::unordered_map in GDB, with pretty-printer customization points</a></li> </ul> </li> </ul> <p>Boost.Unordered can be installed in a number of ways:</p> <ul> <li><a href="https://www.boost.org/users/download/">Download Boost</a> and you're ready to go (this is a header-only library requiring no building).</li> <li>Using Conan 2: In case you don't have it yet, add an entry for Boost in your <code>conanfile.txt</code> (the example requires at least Boost 1.86):</li> </ul> <pre class="highlightjs highlight"><code class="language- hljs">[requires] boost/[>=1.86.0] </code></pre> <ul>If you're not using any compiled Boost library, the following will skip building altogether:</ul> <pre class="highlightjs highlight"><code class="language- hljs">[options] boost:header_only=True </code></pre> <ul> <li>Using vcpkg: Execute the command</li> </ul> <pre class="highlightjs highlight"><code class="language- hljs">vcpkg install boost-unordered </code></pre> <ul> <li>Using CMake: <a href="https://github.com/boostorg/cmake">Boost CMake support infrastructure</a> allows you to use CMake directly to download, build and consume all of Boost or some specific libraries.</li> </ul> <h2>Support</h2> <ul> <li>Join the <strong>#boost-unordered</strong> discussion group at <a href="https://cpplang.slack.com/">cpplang.slack.com</a> (<a href="https://cppalliance.org/slack/">ask for an invite</a> if you’re not a member of this workspace yet)</li> <li>Ask in the <a href="https://lists.boost.org/mailman/listinfo.cgi/boost-users">Boost Users mailing list</a> (add the <code>[unordered]</code> tag at the beginning of the subject line)</li> <li><a href="https://github.com/boostorg/unordered/issues">File an issue</a></li> </ul> <h2>Contribute</h2> <ul> <li><a href="https://github.com/boostorg/unordered/pulls">Pull requests</a> against <strong>develop</strong> branch are most welcome. Note that by submitting patches you agree to license your modifications under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</li> </ul>