2
0
mirror of https://github.com/boostorg/bimap.git synced 2026-01-19 04:02:10 +00:00

Fix/compatibility multi_index 1.91 (#50)

* adapted core to Mp11-based index specification in MultiIndex

* updated CI

* removed Clang 5.0 -std=c++1z as not supported by Mp11

* updated release notes
This commit is contained in:
joaquintides
2025-11-05 21:22:56 +01:00
committed by GitHub
parent f64de6d045
commit 25a3fd8a3c
4 changed files with 126 additions and 34 deletions

View File

@@ -7,6 +7,7 @@ on:
- master
- develop
- feature/**
- fix/**
env:
UBSAN_OPTIONS: print_stacktrace=1
@@ -37,22 +38,26 @@ jobs:
address-model: 32,64
- toolset: gcc-7
cxxstd: "11,14,17"
os: ubuntu-20.04
container: ubuntu:20.04
os: ubuntu-latest
install: g++-7-multilib
address-model: 32,64
- toolset: gcc-8
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
container: ubuntu:20.04
os: ubuntu-latest
install: g++-8-multilib
address-model: 32,64
- toolset: gcc-9
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
container: ubuntu:20.04
os: ubuntu-latest
install: g++-9-multilib
address-model: 32,64
- toolset: gcc-10
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
container: ubuntu:20.04
os: ubuntu-latest
install: g++-10-multilib
address-model: 32,64
- toolset: gcc-11
@@ -67,7 +72,7 @@ jobs:
address-model: 32,64
- toolset: gcc-13
cxxstd: "11,14,17,20,2b"
container: ubuntu:23.04
container: ubuntu:24.04
os: ubuntu-latest
install: g++-13-multilib
address-model: 32,64
@@ -91,42 +96,52 @@ jobs:
install: clang-4.0
- toolset: clang
compiler: clang++-5.0
cxxstd: "11,14,1z"
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:18.04
install: clang-5.0
- toolset: clang
compiler: clang++-6.0
cxxstd: "11,14,17"
os: ubuntu-20.04
os: ubuntu-latest
container: ubuntu:18.04
install: clang-6.0
- toolset: clang
compiler: clang++-7
cxxstd: "11,14,17"
os: ubuntu-20.04
os: ubuntu-latest
container: ubuntu:18.04
install: clang-7
- toolset: clang
compiler: clang++-8
cxxstd: "11,14,17"
os: ubuntu-20.04
os: ubuntu-latest
container: ubuntu:20.04
install: clang-8
- toolset: clang
compiler: clang++-9
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
os: ubuntu-latest
container: ubuntu:20.04
install: clang-9
- toolset: clang
compiler: clang++-10
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
os: ubuntu-latest
container: ubuntu:20.04
install: clang-10
- toolset: clang
compiler: clang++-11
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
os: ubuntu-latest
container: ubuntu:20.04
install: clang-11
- toolset: clang
compiler: clang++-12
cxxstd: "11,14,17,20"
os: ubuntu-20.04
os: ubuntu-latest
container: ubuntu:20.04
install: clang-12
- toolset: clang
compiler: clang++-13
cxxstd: "11,14,17,20,2b"
@@ -148,13 +163,13 @@ jobs:
- toolset: clang
compiler: clang++-16
cxxstd: "11,14,17,20,2b"
container: ubuntu:23.04
container: ubuntu:24.04
os: ubuntu-latest
install: clang-16
- toolset: clang
compiler: clang++-17
cxxstd: "11,14,17,20,2b"
container: ubuntu:23.10
container: ubuntu:24.04
os: ubuntu-latest
install: clang-17
- toolset: clang
@@ -163,9 +178,6 @@ jobs:
container: ubuntu:24.04
os: ubuntu-latest
install: clang-18
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-12
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-13
@@ -174,25 +186,33 @@ jobs:
os: macos-14
runs-on: ${{matrix.os}}
container: ${{matrix.container}}
container:
image: ${{matrix.container}}
volumes:
- /node20217:/node20217:rw,rshared
- ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }}
defaults:
run:
shell: bash
steps:
- name: Setup container environment
if: matrix.container
run: |
apt-get update
apt-get -y install sudo python3 git g++ curl xz-utils
if [[ "${{matrix.container}}" == "ubuntu:1"* ]]; then
# Node 20 doesn't work with Ubuntu 16/18 glibc: https://github.com/actions/checkout/issues/1590
curl -sL https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz | tar -xJ --strip-components 1 -C /node20217
fi
- name: Enable Node 16
run: |
echo "ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Setup container environment
if: matrix.container
run: |
apt-get update
apt-get -y install sudo python3 git g++
- name: Install packages
if: matrix.install
run: |
@@ -237,14 +257,6 @@ jobs:
fail-fast: false
matrix:
include:
- toolset: msvc-14.0
cxxstd: 14,latest
addrmd: 32,64
os: windows-2019
- toolset: msvc-14.2
cxxstd: "14,17,20,latest"
addrmd: 32,64
os: windows-2019
- toolset: msvc-14.3
cxxstd: "14,17,20,latest"
addrmd: 32,64
@@ -256,7 +268,7 @@ jobs:
- toolset: gcc
cxxstd: "11,14,17,2a"
addrmd: 64
os: windows-2019
os: windows-2022
runs-on: ${{matrix.os}}

View File

@@ -14,6 +14,10 @@ http://www.boost.org/LICENSE_1_0.txt)
[section Release notes]
[heading Boost 1.91 release]
* Adapted the library to work with the latest updates of Boost.MultiIndex ([@https://github.com/boostorg/bimap/pull/49 PR#49]).
[heading Boost 1.85 release]
* Fixed heterogeneous lookup for side collections ([@https://github.com/boostorg/bimap/pull/42 PR#42]).

View File

@@ -1,6 +1,7 @@
// Boost.Bimap
//
// Copyright (c) 2006-2007 Matias Capeletto
// Copyright (c) 2025 Joaquin M Lopez Munoz
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -45,6 +46,10 @@
#include <boost/bimap/detail/map_view_iterator.hpp>
#include <boost/bimap/detail/set_view_iterator.hpp>
#ifndef BOOST_MULTI_INDEX_ENABLE_MPL_SUPPORT
#include <boost/bimap/detail/mpl_to_mp11_list.hpp>
#endif
#include <boost/bimap/set_of.hpp>
#include <boost/bimap/unconstrained_set_of.hpp>
#include <boost/core/allocator_access.hpp>
@@ -394,8 +399,16 @@ class bimap_core
>::type complete_core_indices;
#ifndef BOOST_MULTI_INDEX_ENABLE_MPL_SUPPORT
using core_indices = mpl_to_mp11_list< complete_core_indices >;
#else
struct core_indices : public complete_core_indices {};
#endif
// Define the core using compute_index_type to translate the
// set type to an multi-index specification
// --------------------------------------------------------------------

View File

@@ -0,0 +1,63 @@
// Boost.Bimap
//
// Copyright (c) 2025 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)
#ifndef BOOST_BIMAP_DETAIL_MPL_TO_MP11_LIST_HPP
#define BOOST_BIMAP_DETAIL_MPL_TO_MP11_LIST_HPP
#if defined(_MSC_VER)
#pragma once
#endif
#include <boost/mp11/list.hpp>
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/next.hpp>
/** \struct boost::bimaps::detail::mpl_to_mp11_list
\brief Converts a MPL sequence to a Mp11 list
\code
using mp11_list = mpl_to_mp11_list< mpl_sequence >;
\endcode
**/
#ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
namespace boost {
namespace bimaps {
namespace detail {
template< typename First, typename Last, typename... Ts >
struct mpl_to_mp11_list_impl: mpl_to_mp11_list_impl
<
typename mpl::next<First>::type, Last,
Ts..., typename mpl::deref<First>::type
> {};
template< typename Last, typename... Ts >
struct mpl_to_mp11_list_impl< Last, Last, Ts... >
{
using type = mp11::mp_list< Ts... >;
};
template< typename TypeList >
using mpl_to_mp11_list=typename mpl_to_mp11_list_impl
<
typename mpl::begin<TypeList>::type,
typename mpl::end<TypeList>::type
>::type;
} // namespace detail
} // namespace bimaps
} // namespace boost
#endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
#endif // BOOST_BIMAP_DETAIL_MPL_TO_MP11_LIST_HPP