mirror of
https://github.com/boostorg/unordered.git
synced 2026-08-06 13:44:12 +02:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 669918498c | |||
| f1e2fa38b0 | |||
| 4fd90dc706 | |||
| b00e7c4624 | |||
| df2dfe6140 | |||
| 08aa7fe1c3 | |||
| 33169aaf41 | |||
| ba00d17236 | |||
| 83395442ab | |||
| d60d9069f0 |
+7
-2
@@ -2,6 +2,8 @@
|
||||
# Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import path ;
|
||||
|
||||
make html_ : build_antora.sh : @run-script ;
|
||||
|
||||
actions run-script
|
||||
@@ -9,15 +11,18 @@ actions run-script
|
||||
bash $(>)
|
||||
}
|
||||
|
||||
path-constant DOC_DIR : . ;
|
||||
.node_modules = [ path.join $(DOC_DIR) node_modules ] ;
|
||||
|
||||
make cleanup_node_modules_ : html_ : @cleanup-node-modules ;
|
||||
|
||||
actions cleanup-node-modules
|
||||
{
|
||||
bash -c "rm -rf node_modules"
|
||||
rm -rf $(.node_modules)
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
alias boostdoc ;
|
||||
explicit boostdoc ;
|
||||
alias boostrelease : html_ ;
|
||||
alias boostrelease : html_ cleanup_node_modules_ ;
|
||||
explicit boostrelease ;
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
npm ci
|
||||
npx antora unordered-playbook.yml
|
||||
@@ -6,6 +6,11 @@
|
||||
:github-pr-url: https://github.com/boostorg/unordered/pull
|
||||
:cpp: C++
|
||||
|
||||
== Release 1.91.0
|
||||
|
||||
* Fixed the returned value of range insertion in concurrent containers
|
||||
({github-pr-url}/344[PR#344^]).
|
||||
|
||||
== Release 1.89.0
|
||||
|
||||
* Deprecated `boost::unordered::hash_is_avalanching` is now a using-declaration of
|
||||
|
||||
@@ -11,7 +11,7 @@ Copyright (C) 2005-2008 Daniel James
|
||||
|
||||
Copyright (C) 2022-2025 Christian Mazakas
|
||||
|
||||
Copyright (C) 2022-2025 Joaquín M López Muñoz
|
||||
Copyright (C) 2022-2026 Joaquín M López Muñoz
|
||||
|
||||
Copyright (C) 2022-2023 Peter Dimov
|
||||
|
||||
|
||||
Generated
+18
-18
@@ -469,9 +469,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "1.1.12",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
|
||||
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
|
||||
"version": "1.1.13",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz",
|
||||
"integrity": "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
@@ -619,9 +619,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/convict": {
|
||||
"version": "6.2.4",
|
||||
"resolved": "https://registry.npmjs.org/convict/-/convict-6.2.4.tgz",
|
||||
"integrity": "sha512-qN60BAwdMVdofckX7AlohVJ2x9UvjTNoKVXCL2LxFk1l7757EJqf1nySdMkPQer0bt8kQ5lQiyZ9/2NvrFBuwQ==",
|
||||
"version": "6.2.5",
|
||||
"resolved": "https://registry.npmjs.org/convict/-/convict-6.2.5.tgz",
|
||||
"integrity": "sha512-JtXpxqDqJ8P0UwEHwhxLzCIXQy97vlYBZR222Sbzb1q1Erex9ASrztJ29SyhWFQjod1AeFBaPzEEC8YvtZMIYg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
@@ -944,9 +944,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/handlebars": {
|
||||
"version": "4.7.8",
|
||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz",
|
||||
"integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==",
|
||||
"version": "4.7.9",
|
||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.9.tgz",
|
||||
"integrity": "sha512-4E71E0rpOaQuJR2A3xDZ+GM1HyWYv1clR58tC8emQNeQe3RH7MAzSbat+V0wG78LQBo6m6bzSG/L4pBuCsgnUQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"minimist": "^1.2.5",
|
||||
@@ -1236,9 +1236,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/micromatch/node_modules/picomatch": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
||||
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
|
||||
"integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8.6"
|
||||
@@ -1281,9 +1281,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"version": "3.1.5",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
|
||||
"integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
@@ -1365,9 +1365,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/picomatch": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
|
||||
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz",
|
||||
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2024-2025 Braden Ganetsky
|
||||
# Copyright 2024-2026 Braden Ganetsky
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
@@ -16,8 +16,14 @@ class BoostUnorderedHelpers:
|
||||
return n
|
||||
|
||||
def maybe_unwrap_foa_element(e):
|
||||
if f"{e.type.strip_typedefs()}".startswith("boost::unordered::detail::foa::element_type<"):
|
||||
return e["p"]
|
||||
# Sometimes the complex typedefs can't be resolved through a pointer
|
||||
if e.type.strip_typedefs().code == gdb.TYPE_CODE_PTR:
|
||||
foa_element = e.dereference()
|
||||
else:
|
||||
foa_element = e
|
||||
|
||||
if f"{foa_element.type.strip_typedefs()}".startswith("boost::unordered::detail::foa::element_type<"):
|
||||
return foa_element["p"]
|
||||
else:
|
||||
return e
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/* Fast open-addressing concurrent hashmap.
|
||||
*
|
||||
* Copyright 2023 Christian Mazakas.
|
||||
* Copyright 2023-2024 Joaquin M Lopez Munoz.
|
||||
* Copyright 2023-2026 Joaquin M Lopez Munoz.
|
||||
* Copyright 2026 Braden Ganetsky
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -189,10 +190,10 @@ namespace boost {
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
template <bool avoid_explicit_instantiation = true>
|
||||
template <typename Key2,
|
||||
typename std::enable_if<std::is_same<Key, Key2>::value, int>::type = 0>
|
||||
concurrent_flat_map(
|
||||
unordered_flat_map<Key, T, Hash, Pred, Allocator>&& other)
|
||||
unordered_flat_map<Key2, T, Hash, Pred, Allocator>&& other)
|
||||
: table_(std::move(other.table_))
|
||||
{
|
||||
}
|
||||
@@ -423,8 +424,8 @@ namespace boost {
|
||||
size_type insert(InputIterator begin, InputIterator end)
|
||||
{
|
||||
size_type count_elements = 0;
|
||||
for (auto pos = begin; pos != end; ++pos, ++count_elements) {
|
||||
table_.emplace(*pos);
|
||||
for (auto pos = begin; pos != end; ++pos) {
|
||||
if (table_.emplace(*pos)) ++count_elements;
|
||||
}
|
||||
return count_elements;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/* Fast open-addressing concurrent hashset.
|
||||
*
|
||||
* Copyright 2023 Christian Mazakas.
|
||||
* Copyright 2023-2024 Joaquin M Lopez Munoz.
|
||||
* Copyright 2023-2026 Joaquin M Lopez Munoz.
|
||||
* Copyright 2026 Braden Ganetsky
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -186,10 +187,10 @@ namespace boost {
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
template <bool avoid_explicit_instantiation = true>
|
||||
template <typename Key2,
|
||||
typename std::enable_if<std::is_same<Key, Key2>::value, int>::type = 0>
|
||||
concurrent_flat_set(
|
||||
unordered_flat_set<Key, Hash, Pred, Allocator>&& other)
|
||||
unordered_flat_set<Key2, Hash, Pred, Allocator>&& other)
|
||||
: table_(std::move(other.table_))
|
||||
{
|
||||
}
|
||||
@@ -429,8 +430,8 @@ namespace boost {
|
||||
size_type insert(InputIterator begin, InputIterator end)
|
||||
{
|
||||
size_type count_elements = 0;
|
||||
for (auto pos = begin; pos != end; ++pos, ++count_elements) {
|
||||
table_.emplace(*pos);
|
||||
for (auto pos = begin; pos != end; ++pos) {
|
||||
if (table_.emplace(*pos)) ++count_elements;
|
||||
}
|
||||
return count_elements;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/* Fast open-addressing, node-based concurrent hashmap.
|
||||
*
|
||||
* Copyright 2023 Christian Mazakas.
|
||||
* Copyright 2023-2024 Joaquin M Lopez Munoz.
|
||||
* Copyright 2023-2026 Joaquin M Lopez Munoz.
|
||||
* Copyright 2026 Braden Ganetsky
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -197,9 +198,10 @@ namespace boost {
|
||||
{
|
||||
}
|
||||
|
||||
template <bool avoid_explicit_instantiation = true>
|
||||
template <typename Key2,
|
||||
typename std::enable_if<std::is_same<Key, Key2>::value, int>::type = 0>
|
||||
concurrent_node_map(
|
||||
unordered_node_map<Key, T, Hash, Pred, Allocator>&& other)
|
||||
unordered_node_map<Key2, T, Hash, Pred, Allocator>&& other)
|
||||
: table_(std::move(other.table_))
|
||||
{
|
||||
}
|
||||
@@ -430,8 +432,8 @@ namespace boost {
|
||||
size_type insert(InputIterator begin, InputIterator end)
|
||||
{
|
||||
size_type count_elements = 0;
|
||||
for (auto pos = begin; pos != end; ++pos, ++count_elements) {
|
||||
table_.emplace(*pos);
|
||||
for (auto pos = begin; pos != end; ++pos) {
|
||||
if (table_.emplace(*pos)) ++count_elements;
|
||||
}
|
||||
return count_elements;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/* Fast open-addressing, node-based concurrent hashset.
|
||||
*
|
||||
* Copyright 2023 Christian Mazakas.
|
||||
* Copyright 2023-2024 Joaquin M Lopez Munoz.
|
||||
* Copyright 2023-2026 Joaquin M Lopez Munoz.
|
||||
* Copyright 2026 Braden Ganetsky
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -194,9 +195,10 @@ namespace boost {
|
||||
{
|
||||
}
|
||||
|
||||
template <bool avoid_explicit_instantiation = true>
|
||||
template <typename Key2,
|
||||
typename std::enable_if<std::is_same<Key, Key2>::value, int>::type = 0>
|
||||
concurrent_node_set(
|
||||
unordered_node_set<Key, Hash, Pred, Allocator>&& other)
|
||||
unordered_node_set<Key2, Hash, Pred, Allocator>&& other)
|
||||
: table_(std::move(other.table_))
|
||||
{
|
||||
}
|
||||
@@ -436,8 +438,8 @@ namespace boost {
|
||||
size_type insert(InputIterator begin, InputIterator end)
|
||||
{
|
||||
size_type count_elements = 0;
|
||||
for (auto pos = begin; pos != end; ++pos, ++count_elements) {
|
||||
table_.emplace(*pos);
|
||||
for (auto pos = begin; pos != end; ++pos) {
|
||||
if (table_.emplace(*pos)) ++count_elements;
|
||||
}
|
||||
return count_elements;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Copyright 2024-2025 Braden Ganetsky
|
||||
// Copyright 2024-2026 Braden Ganetsky
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
// Generated on 2025-08-21T03:09:19
|
||||
// Generated on 2026-01-24T00:34:53
|
||||
|
||||
#ifndef BOOST_UNORDERED_DETAIL_UNORDERED_PRINTERS_HPP
|
||||
#define BOOST_UNORDERED_DETAIL_UNORDERED_PRINTERS_HPP
|
||||
@@ -29,8 +29,14 @@ __asm__(".pushsection \".debug_gdb_scripts\", \"MS\",%progbits,1\n"
|
||||
".ascii \" return n\\n\"\n"
|
||||
|
||||
".ascii \" def maybe_unwrap_foa_element(e):\\n\"\n"
|
||||
".ascii \" if f\\\"{e.type.strip_typedefs()}\\\".startswith(\\\"boost::unordered::detail::foa::element_type<\\\"):\\n\"\n"
|
||||
".ascii \" return e[\\\"p\\\"]\\n\"\n"
|
||||
".ascii \" # Sometimes the complex typedefs can't be resolved through a pointer\\n\"\n"
|
||||
".ascii \" if e.type.strip_typedefs().code == gdb.TYPE_CODE_PTR:\\n\"\n"
|
||||
".ascii \" foa_element = e.dereference()\\n\"\n"
|
||||
".ascii \" else:\\n\"\n"
|
||||
".ascii \" foa_element = e\\n\"\n"
|
||||
|
||||
".ascii \" if f\\\"{foa_element.type.strip_typedefs()}\\\".startswith(\\\"boost::unordered::detail::foa::element_type<\\\"):\\n\"\n"
|
||||
".ascii \" return foa_element[\\\"p\\\"]\\n\"\n"
|
||||
".ascii \" else:\\n\"\n"
|
||||
".ascii \" return e\\n\"\n"
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright (C) 2022-2023 Christian Mazakas
|
||||
// Copyright (C) 2024-2025 Joaquin M Lopez Munoz
|
||||
// Copyright (C) 2026 Braden Ganetsky
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@@ -182,9 +183,10 @@ namespace boost {
|
||||
{
|
||||
}
|
||||
|
||||
template <bool avoid_explicit_instantiation = true>
|
||||
template <typename Key2,
|
||||
typename std::enable_if<std::is_same<Key, Key2>::value, int>::type = 0>
|
||||
unordered_flat_map(
|
||||
concurrent_flat_map<Key, T, Hash, KeyEqual, Allocator>&& other)
|
||||
concurrent_flat_map<Key2, T, Hash, KeyEqual, Allocator>&& other)
|
||||
: table_(std::move(other.table_))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright (C) 2022-2023 Christian Mazakas
|
||||
// Copyright (C) 2024-2025 Joaquin M Lopez Munoz
|
||||
// Copyright (C) 2026 Braden Ganetsky
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@@ -178,9 +179,10 @@ namespace boost {
|
||||
{
|
||||
}
|
||||
|
||||
template <bool avoid_explicit_instantiation = true>
|
||||
template <typename Key2,
|
||||
typename std::enable_if<std::is_same<Key, Key2>::value, int>::type = 0>
|
||||
unordered_flat_set(
|
||||
concurrent_flat_set<Key, Hash, KeyEqual, Allocator>&& other)
|
||||
concurrent_flat_set<Key2, Hash, KeyEqual, Allocator>&& other)
|
||||
: table_(std::move(other.table_))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright (C) 2022-2023 Christian Mazakas
|
||||
// Copyright (C) 2024-2025 Joaquin M Lopez Munoz
|
||||
// Copyright (C) 2026 Braden Ganetsky
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@@ -189,9 +190,10 @@ namespace boost {
|
||||
{
|
||||
}
|
||||
|
||||
template <bool avoid_explicit_instantiation = true>
|
||||
template <typename Key2,
|
||||
typename std::enable_if<std::is_same<Key, Key2>::value, int>::type = 0>
|
||||
unordered_node_map(
|
||||
concurrent_node_map<Key, T, Hash, KeyEqual, Allocator>&& other)
|
||||
concurrent_node_map<Key2, T, Hash, KeyEqual, Allocator>&& other)
|
||||
: table_(std::move(other.table_))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright (C) 2022-2023 Christian Mazakas
|
||||
// Copyright (C) 2024-2025 Joaquin M Lopez Munoz
|
||||
// Copyright (C) 2026 Braden Ganetsky
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@@ -187,9 +188,10 @@ namespace boost {
|
||||
{
|
||||
}
|
||||
|
||||
template <bool avoid_explicit_instantiation = true>
|
||||
template <typename Key2,
|
||||
typename std::enable_if<std::is_same<Key, Key2>::value, int>::type = 0>
|
||||
unordered_node_set(
|
||||
concurrent_node_set<Key, Hash, KeyEqual, Allocator>&& other)
|
||||
concurrent_node_set<Key2, Hash, KeyEqual, Allocator>&& other)
|
||||
: table_(std::move(other.table_))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -163,4 +163,13 @@ cfoa_tests(SOURCES cfoa/rw_spinlock_test6.cpp)
|
||||
cfoa_tests(SOURCES cfoa/rw_spinlock_test7.cpp)
|
||||
cfoa_tests(SOURCES cfoa/rw_spinlock_test8.cpp)
|
||||
|
||||
# Compile tests
|
||||
|
||||
fca_tests(TYPE compile NAME explicit_instantiation_tests SOURCES unordered/explicit_instantiation_tests.cpp)
|
||||
foa_tests(TYPE compile NAME explicit_instantiation_tests SOURCES unordered/explicit_instantiation_tests.cpp)
|
||||
cfoa_tests(TYPE compile NAME explicit_instantiation_tests SOURCES cfoa/explicit_instantiation_tests.cpp)
|
||||
|
||||
foa_tests(TYPE compile NAME conversion_operator_tests SOURCES unordered/conversion_operator_tests.cpp)
|
||||
cfoa_tests(TYPE compile NAME conversion_operator_tests SOURCES cfoa/conversion_operator_tests.cpp)
|
||||
|
||||
endif()
|
||||
|
||||
@@ -166,6 +166,9 @@ compile unordered/explicit_instantiation_tests.cpp :
|
||||
compile unordered/explicit_instantiation_tests.cpp : <define>BOOST_UNORDERED_FOA_TESTS : foa_explicit_instantiation_tests ;
|
||||
compile cfoa/explicit_instantiation_tests.cpp : : cfoa_explicit_instantiation_tests ;
|
||||
|
||||
compile unordered/conversion_operator_tests.cpp : <define>BOOST_UNORDERED_FOA_TESTS : foa_conversion_operator_tests ;
|
||||
compile cfoa/conversion_operator_tests.cpp : : cfoa_conversion_operator_tests ;
|
||||
|
||||
local FCA_EXCEPTION_TESTS =
|
||||
constructor_exception_tests
|
||||
copy_exception_tests
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
// Copyright 2026 Braden Ganetsky
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/unordered/concurrent_flat_map.hpp>
|
||||
#include <boost/unordered/concurrent_flat_set.hpp>
|
||||
#include <boost/unordered/concurrent_node_map.hpp>
|
||||
#include <boost/unordered/concurrent_node_set.hpp>
|
||||
// Don't include the FOA headers here!
|
||||
|
||||
using c_flat_map = boost::unordered::concurrent_flat_map<int, int>;
|
||||
using c_flat_set = boost::unordered::concurrent_flat_set<int>;
|
||||
using c_node_map = boost::unordered::concurrent_node_map<int, int>;
|
||||
using c_node_set = boost::unordered::concurrent_node_set<int>;
|
||||
|
||||
struct constrained_template_converter
|
||||
{
|
||||
struct dummy
|
||||
{
|
||||
};
|
||||
template <class T, typename std::enable_if<
|
||||
std::is_constructible<T, dummy>::value, int>::type = 0>
|
||||
operator T() const
|
||||
{
|
||||
return T{};
|
||||
}
|
||||
};
|
||||
|
||||
// Check whether the corresponding FOA container gets instantiated.
|
||||
// The FOA headers aren't included, so this would fail to compile if the FOA
|
||||
// container was instantiated.
|
||||
BOOST_STATIC_ASSERT(
|
||||
(!std::is_constructible<c_flat_map, constrained_template_converter>::value));
|
||||
BOOST_STATIC_ASSERT(
|
||||
(!std::is_constructible<c_flat_set, constrained_template_converter>::value));
|
||||
BOOST_STATIC_ASSERT(
|
||||
(!std::is_constructible<c_node_map, constrained_template_converter>::value));
|
||||
BOOST_STATIC_ASSERT(
|
||||
(!std::is_constructible<c_node_set, constrained_template_converter>::value));
|
||||
|
||||
int main() { return 0; }
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright (C) 2023 Christian Mazakas
|
||||
// Copyright (C) 2023-2024 Joaquin M Lopez Munoz
|
||||
// Copyright (C) 2023-2026 Joaquin M Lopez Munoz
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@@ -148,12 +148,18 @@ namespace {
|
||||
values2.push_back(raii_convertible(v));
|
||||
}
|
||||
|
||||
thread_runner(values2, [&x](boost::span<raii_convertible> s) {
|
||||
BOOST_TEST_EQ(x.insert(s.begin(), s.end()), s.size());
|
||||
auto sz = x.size();
|
||||
std::atomic<std::uint64_t> num_inserts{0};
|
||||
std::atomic<std::uint64_t> num_attempted_inserts{0};
|
||||
thread_runner(values2, [&x, &num_inserts, &num_attempted_inserts](boost::span<raii_convertible> s) {
|
||||
num_inserts += x.insert(s.begin(), s.begin() + s.size() / 2);
|
||||
num_inserts += x.insert(s.begin(), s.end());
|
||||
num_attempted_inserts += s.size() + s.size() / 2;
|
||||
});
|
||||
BOOST_TEST_EQ(x.size(), sz + num_inserts);
|
||||
|
||||
BOOST_TEST_EQ(
|
||||
raii::default_constructor, value_type_cardinality * values2.size());
|
||||
raii::default_constructor, value_type_cardinality * num_attempted_inserts);
|
||||
#if BOOST_WORKAROUND(BOOST_GCC_VERSION, >= 50300) && \
|
||||
BOOST_WORKAROUND(BOOST_GCC_VERSION, < 50500)
|
||||
// some versions of old gcc have trouble eliding copies here
|
||||
@@ -1010,9 +1016,11 @@ namespace {
|
||||
{
|
||||
X x;
|
||||
|
||||
thread_runner(dummy, [&x, &init_list](boost::span<raii>) {
|
||||
BOOST_TEST_EQ(x.insert(init_list), init_list.size());
|
||||
std::atomic<std::uint64_t> num_inserts{0};
|
||||
thread_runner(dummy, [&x, &init_list, &num_inserts](boost::span<raii>) {
|
||||
num_inserts += x.insert(init_list);
|
||||
});
|
||||
BOOST_TEST_EQ(num_inserts, x.size());
|
||||
|
||||
BOOST_TEST_EQ(x.size(), reference_cont.size());
|
||||
|
||||
|
||||
@@ -18,14 +18,9 @@ assert
|
||||
config
|
||||
container_hash
|
||||
core
|
||||
move
|
||||
mp11
|
||||
predef
|
||||
preprocessor
|
||||
static_assert
|
||||
throw_exception
|
||||
tuple
|
||||
type_traits
|
||||
|
||||
# Secondary dependencies
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
// Copyright 2026 Braden Ganetsky
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#if !defined(BOOST_UNORDERED_FOA_TESTS)
|
||||
#error "This test is only for the FOA-style conatiners"
|
||||
#endif
|
||||
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/unordered/unordered_flat_map.hpp>
|
||||
#include <boost/unordered/unordered_flat_set.hpp>
|
||||
#include <boost/unordered/unordered_node_map.hpp>
|
||||
#include <boost/unordered/unordered_node_set.hpp>
|
||||
// Don't include the CFOA headers here!
|
||||
|
||||
using flat_map = boost::unordered::unordered_flat_map<int, int>;
|
||||
using flat_set = boost::unordered::unordered_flat_set<int>;
|
||||
using node_map = boost::unordered::unordered_node_map<int, int>;
|
||||
using node_set = boost::unordered::unordered_node_set<int>;
|
||||
|
||||
struct constrained_template_converter
|
||||
{
|
||||
struct dummy
|
||||
{
|
||||
};
|
||||
template <class T, typename std::enable_if<
|
||||
std::is_constructible<T, dummy>::value, int>::type = 0>
|
||||
operator T() const
|
||||
{
|
||||
return T{};
|
||||
}
|
||||
};
|
||||
|
||||
// Check whether the corresponding CFOA container gets instantiated.
|
||||
// The CFOA headers aren't included, so this would fail to compile if the CFOA
|
||||
// container was instantiated.
|
||||
BOOST_STATIC_ASSERT(
|
||||
(!std::is_constructible<flat_map, constrained_template_converter>::value));
|
||||
BOOST_STATIC_ASSERT(
|
||||
(!std::is_constructible<flat_set, constrained_template_converter>::value));
|
||||
BOOST_STATIC_ASSERT(
|
||||
(!std::is_constructible<node_map, constrained_template_converter>::value));
|
||||
BOOST_STATIC_ASSERT(
|
||||
(!std::is_constructible<node_set, constrained_template_converter>::value));
|
||||
|
||||
int main() { return 0; }
|
||||
Reference in New Issue
Block a user