Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ jobs:
- { compiler: gcc-12, cxxstd: '11,14,17,20', os: 'ubuntu-22.04', install: 'g++-12' }
- { compiler: gcc-13, cxxstd: '11,14,17,20', os: 'ubuntu-24.04', install: 'g++-13' }
- { compiler: gcc-14, cxxstd: '11,14,17,20', os: 'ubuntu-24.04', install: 'g++-14' }
- { compiler: gcc-16, cxxstd: '11,14,17', container: 'ubuntu:26.04', os: 'ubuntu-latest', install: 'g++-16-multilib' }
- { compiler: gcc-16, cxxstd: '20,23,2c', container: 'ubuntu:26.04', os: 'ubuntu-latest', install: 'g++-16-multilib' }

- { name: "gcc-14 w/ sanitizers (11)", sanitize: yes,
compiler: gcc-14, cxxstd: '11', os: 'ubuntu-24.04', install: 'g++-14', ccache_key: "san1" }
- { name: "gcc-14 w/ sanitizers (14)", sanitize: yes,
Expand All @@ -72,7 +75,6 @@ jobs:
compiler: gcc-14, cxxstd: '2b', os: 'ubuntu-24.04', install: 'g++-14', ccache_key: "san2" }
- { name: Collect coverage, coverage: yes,
compiler: gcc-14, cxxstd: '20', os: 'ubuntu-24.04', install: 'g++-14 g++-14-multilib', address-model: '32,64', ccache_key: "cov" }

- { name: "cfoa tsan (gcc-14)", cxxstd: '11,14,17,20,2b', os: 'ubuntu-24.04', install: 'g++-14', compiler: gcc-14,
targets: 'libs/unordered/test//cfoa_tests', thread-sanitize: yes, ccache_key: "tsan" }

Expand Down Expand Up @@ -145,10 +147,11 @@ jobs:
fi
if [ -n "${{matrix.container}}" ] && [ -f "/etc/debian_version" ]; then
apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common dirmngr
# Need (newer) git, and the older Ubuntu container may require requesting the key manually using port 80
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E1DD270288B4E6030699E45FA1715D88E1DF1F24
for i in {1..${NET_RETRY_COUNT:-3}}; do sudo -E add-apt-repository -y ppa:git-core/ppa && break || sleep 10; done
mkdir -p /etc/apt/trusted.gpg.d ~/.gnupg
gpg --no-default-keyring --keyring /etc/apt/trusted.gpg.d/git-core.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E1DD270288B4E6030699E45FA1715D88E1DF1F24
for i in {1..${NET_RETRY_COUNT:-3}}; do sudo -E add-apt-repository -y ppa:git-core/ppa && break || sleep 10; done
apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y g++ python-is-python3 git
fi
Expand Down
6 changes: 3 additions & 3 deletions include/boost/unordered/detail/foa/concurrent_table.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Fast open-addressing concurrent hash table.
*
* Copyright 2023-2024 Joaquin M Lopez Munoz.
* Copyright 2023-2026 Joaquin M Lopez Munoz.
* Copyright 2024 Braden Ganetsky.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
Expand Down Expand Up @@ -697,9 +697,9 @@ class concurrent_table:
}

/* Optimizations for maps for (k,v) to avoid eagerly constructing value */
template <typename K, typename V>
template <typename K, typename V, typename Table = concurrent_table>
BOOST_FORCEINLINE auto emplace(K&& k, V&& v) ->
typename std::enable_if<is_emplace_kv_able<concurrent_table, K>::value,
typename std::enable_if<is_emplace_kv_able<Table, K>::value,
bool>::type
{
alloc_cted_or_fwded_key_type<type_policy, Allocator, K&&> x(
Expand Down
4 changes: 2 additions & 2 deletions include/boost/unordered/detail/foa/core.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Common base for Boost.Unordered open-addressing tables.
*
* Copyright 2022-2025 Joaquin M Lopez Munoz.
* Copyright 2022-2026 Joaquin M Lopez Munoz.
* Copyright 2023 Christian Mazakas.
* Copyright 2024 Braden Ganetsky.
* Distributed under the Boost Software License, Version 1.0.
Expand Down Expand Up @@ -1349,7 +1349,7 @@ template <typename Container, typename K>
using is_emplace_kv_able = std::integral_constant<bool,
is_map<Container>::value &&
(is_similar<K, typename Container::key_type>::value ||
is_complete_and_move_constructible<typename Container::key_type>::value)>;
std::is_move_constructible<typename Container::key_type>::value)>;

/* table_core. The TypePolicy template parameter is used to generate
* instantiations suitable for either maps or sets, and introduces non-standard
Expand Down
6 changes: 3 additions & 3 deletions include/boost/unordered/detail/foa/table.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Fast open-addressing hash table.
*
* Copyright 2022-2025 Joaquin M Lopez Munoz.
* Copyright 2022-2026 Joaquin M Lopez Munoz.
* Copyright 2023 Christian Mazakas.
* Copyright 2024 Braden Ganetsky.
* Distributed under the Boost Software License, Version 1.0.
Expand Down Expand Up @@ -422,9 +422,9 @@ class table:table_core_impl<TypePolicy,Hash,Pred,Allocator>
}

/* Optimizations for maps for (k,v) to avoid eagerly constructing value */
template <typename K, typename V>
template <typename K, typename V, typename Table = table>
BOOST_FORCEINLINE
typename std::enable_if<is_emplace_kv_able<table, K>::value,
typename std::enable_if<is_emplace_kv_able<Table, K>::value,
std::pair<iterator, bool> >::type
emplace(K&& k, V&& v)
{
Expand Down
6 changes: 3 additions & 3 deletions include/boost/unordered/detail/implementation.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2003-2004 Jeremy B. Maitin-Shepard.
// Copyright (C) 2005-2016 Daniel James
// Copyright (C) 2022-2024 Joaquin M Lopez Munoz.
// Copyright (C) 2022-2026 Joaquin M Lopez Munoz.
// Copyright (C) 2022-2023 Christian Mazakas
// Copyright (C) 2024 Braden Ganetsky
//
Expand Down Expand Up @@ -2851,10 +2851,10 @@ namespace boost {
return no_key();
}

template <class Arg1, class Arg2>
template <class Arg1, class Arg2, class Key = key_type>
static typename std::conditional<
(is_similar<Arg1, key_type>::value ||
is_complete_and_move_constructible<key_type>::value),
std::is_move_constructible<Key>::value),
converting_key, no_key>::type
extract(Arg1 const&, Arg2 const&)
{
Expand Down
15 changes: 1 addition & 14 deletions include/boost/unordered/detail/type_traits.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (C) 2022-2023 Christian Mazakas
// Copyright (C) 2024 Braden Ganetsky
// Copyright (C) 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)
Expand Down Expand Up @@ -49,20 +50,6 @@ namespace boost {

template <typename... Ts> using void_t = typename make_void<Ts...>::type;

template <class T, class = void> struct is_complete : std::false_type
{
};

template <class T>
struct is_complete<T, void_t<int[sizeof(T)]> > : std::true_type
{
};

template <class T>
using is_complete_and_move_constructible =
typename std::conditional<is_complete<T>::value,
std::is_move_constructible<T>, std::false_type>::type;

#if BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION, < 50000)
/* std::is_trivially_default_constructible not provided */
template <class T>
Expand Down
Loading