Skip to content

Commit 25a3fd8

Browse files
authored
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
1 parent f64de6d commit 25a3fd8

4 files changed

Lines changed: 126 additions & 34 deletions

File tree

.github/workflows/ci.yml

Lines changed: 46 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- master
88
- develop
99
- feature/**
10+
- fix/**
1011

1112
env:
1213
UBSAN_OPTIONS: print_stacktrace=1
@@ -37,22 +38,26 @@ jobs:
3738
address-model: 32,64
3839
- toolset: gcc-7
3940
cxxstd: "11,14,17"
40-
os: ubuntu-20.04
41+
container: ubuntu:20.04
42+
os: ubuntu-latest
4143
install: g++-7-multilib
4244
address-model: 32,64
4345
- toolset: gcc-8
4446
cxxstd: "11,14,17,2a"
45-
os: ubuntu-20.04
47+
container: ubuntu:20.04
48+
os: ubuntu-latest
4649
install: g++-8-multilib
4750
address-model: 32,64
4851
- toolset: gcc-9
4952
cxxstd: "11,14,17,2a"
50-
os: ubuntu-20.04
53+
container: ubuntu:20.04
54+
os: ubuntu-latest
5155
install: g++-9-multilib
5256
address-model: 32,64
5357
- toolset: gcc-10
5458
cxxstd: "11,14,17,2a"
55-
os: ubuntu-20.04
59+
container: ubuntu:20.04
60+
os: ubuntu-latest
5661
install: g++-10-multilib
5762
address-model: 32,64
5863
- toolset: gcc-11
@@ -67,7 +72,7 @@ jobs:
6772
address-model: 32,64
6873
- toolset: gcc-13
6974
cxxstd: "11,14,17,20,2b"
70-
container: ubuntu:23.04
75+
container: ubuntu:24.04
7176
os: ubuntu-latest
7277
install: g++-13-multilib
7378
address-model: 32,64
@@ -91,42 +96,52 @@ jobs:
9196
install: clang-4.0
9297
- toolset: clang
9398
compiler: clang++-5.0
94-
cxxstd: "11,14,1z"
99+
cxxstd: "11,14"
95100
os: ubuntu-latest
96101
container: ubuntu:18.04
97102
install: clang-5.0
98103
- toolset: clang
99104
compiler: clang++-6.0
100105
cxxstd: "11,14,17"
101-
os: ubuntu-20.04
106+
os: ubuntu-latest
107+
container: ubuntu:18.04
102108
install: clang-6.0
103109
- toolset: clang
104110
compiler: clang++-7
105111
cxxstd: "11,14,17"
106-
os: ubuntu-20.04
112+
os: ubuntu-latest
113+
container: ubuntu:18.04
107114
install: clang-7
108115
- toolset: clang
109116
compiler: clang++-8
110117
cxxstd: "11,14,17"
111-
os: ubuntu-20.04
118+
os: ubuntu-latest
119+
container: ubuntu:20.04
112120
install: clang-8
113121
- toolset: clang
114122
compiler: clang++-9
115123
cxxstd: "11,14,17,2a"
116-
os: ubuntu-20.04
124+
os: ubuntu-latest
125+
container: ubuntu:20.04
117126
install: clang-9
118127
- toolset: clang
119128
compiler: clang++-10
120129
cxxstd: "11,14,17,2a"
121-
os: ubuntu-20.04
130+
os: ubuntu-latest
131+
container: ubuntu:20.04
132+
install: clang-10
122133
- toolset: clang
123134
compiler: clang++-11
124135
cxxstd: "11,14,17,2a"
125-
os: ubuntu-20.04
136+
os: ubuntu-latest
137+
container: ubuntu:20.04
138+
install: clang-11
126139
- toolset: clang
127140
compiler: clang++-12
128141
cxxstd: "11,14,17,20"
129-
os: ubuntu-20.04
142+
os: ubuntu-latest
143+
container: ubuntu:20.04
144+
install: clang-12
130145
- toolset: clang
131146
compiler: clang++-13
132147
cxxstd: "11,14,17,20,2b"
@@ -148,13 +163,13 @@ jobs:
148163
- toolset: clang
149164
compiler: clang++-16
150165
cxxstd: "11,14,17,20,2b"
151-
container: ubuntu:23.04
166+
container: ubuntu:24.04
152167
os: ubuntu-latest
153168
install: clang-16
154169
- toolset: clang
155170
compiler: clang++-17
156171
cxxstd: "11,14,17,20,2b"
157-
container: ubuntu:23.10
172+
container: ubuntu:24.04
158173
os: ubuntu-latest
159174
install: clang-17
160175
- toolset: clang
@@ -163,9 +178,6 @@ jobs:
163178
container: ubuntu:24.04
164179
os: ubuntu-latest
165180
install: clang-18
166-
- toolset: clang
167-
cxxstd: "11,14,17,20,2b"
168-
os: macos-12
169181
- toolset: clang
170182
cxxstd: "11,14,17,20,2b"
171183
os: macos-13
@@ -174,25 +186,33 @@ jobs:
174186
os: macos-14
175187

176188
runs-on: ${{matrix.os}}
177-
container: ${{matrix.container}}
189+
container:
190+
image: ${{matrix.container}}
191+
volumes:
192+
- /node20217:/node20217:rw,rshared
193+
- ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }}
178194

179195
defaults:
180196
run:
181197
shell: bash
182198

183199
steps:
200+
- name: Setup container environment
201+
if: matrix.container
202+
run: |
203+
apt-get update
204+
apt-get -y install sudo python3 git g++ curl xz-utils
205+
if [[ "${{matrix.container}}" == "ubuntu:1"* ]]; then
206+
# Node 20 doesn't work with Ubuntu 16/18 glibc: https://github.com/actions/checkout/issues/1590
207+
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
208+
fi
209+
184210
- name: Enable Node 16
185211
run: |
186212
echo "ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true" >> $GITHUB_ENV
187213
188214
- uses: actions/checkout@v3
189215

190-
- name: Setup container environment
191-
if: matrix.container
192-
run: |
193-
apt-get update
194-
apt-get -y install sudo python3 git g++
195-
196216
- name: Install packages
197217
if: matrix.install
198218
run: |
@@ -237,14 +257,6 @@ jobs:
237257
fail-fast: false
238258
matrix:
239259
include:
240-
- toolset: msvc-14.0
241-
cxxstd: 14,latest
242-
addrmd: 32,64
243-
os: windows-2019
244-
- toolset: msvc-14.2
245-
cxxstd: "14,17,20,latest"
246-
addrmd: 32,64
247-
os: windows-2019
248260
- toolset: msvc-14.3
249261
cxxstd: "14,17,20,latest"
250262
addrmd: 32,64
@@ -256,7 +268,7 @@ jobs:
256268
- toolset: gcc
257269
cxxstd: "11,14,17,2a"
258270
addrmd: 64
259-
os: windows-2019
271+
os: windows-2022
260272

261273
runs-on: ${{matrix.os}}
262274

doc/release_notes.qbk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ http://www.boost.org/LICENSE_1_0.txt)
1414

1515
[section Release notes]
1616

17+
[heading Boost 1.91 release]
18+
19+
* Adapted the library to work with the latest updates of Boost.MultiIndex ([@https://github.com/boostorg/bimap/pull/49 PR#49]).
20+
1721
[heading Boost 1.85 release]
1822

1923
* Fixed heterogeneous lookup for side collections ([@https://github.com/boostorg/bimap/pull/42 PR#42]).

include/boost/bimap/detail/bimap_core.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Boost.Bimap
22
//
33
// Copyright (c) 2006-2007 Matias Capeletto
4+
// Copyright (c) 2025 Joaquin M Lopez Munoz
45
//
56
// Distributed under the Boost Software License, Version 1.0.
67
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -45,6 +46,10 @@
4546
#include <boost/bimap/detail/map_view_iterator.hpp>
4647
#include <boost/bimap/detail/set_view_iterator.hpp>
4748

49+
#ifndef BOOST_MULTI_INDEX_ENABLE_MPL_SUPPORT
50+
#include <boost/bimap/detail/mpl_to_mp11_list.hpp>
51+
#endif
52+
4853
#include <boost/bimap/set_of.hpp>
4954
#include <boost/bimap/unconstrained_set_of.hpp>
5055
#include <boost/core/allocator_access.hpp>
@@ -394,8 +399,16 @@ class bimap_core
394399

395400
>::type complete_core_indices;
396401

402+
#ifndef BOOST_MULTI_INDEX_ENABLE_MPL_SUPPORT
403+
404+
using core_indices = mpl_to_mp11_list< complete_core_indices >;
405+
406+
#else
407+
397408
struct core_indices : public complete_core_indices {};
398409

410+
#endif
411+
399412
// Define the core using compute_index_type to translate the
400413
// set type to an multi-index specification
401414
// --------------------------------------------------------------------
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// Boost.Bimap
2+
//
3+
// Copyright (c) 2025 Joaquin M Lopez Munoz
4+
//
5+
// Distributed under the Boost Software License, Version 1.0.
6+
// (See accompanying file LICENSE_1_0.txt or copy at
7+
// http://www.boost.org/LICENSE_1_0.txt)
8+
9+
10+
#ifndef BOOST_BIMAP_DETAIL_MPL_TO_MP11_LIST_HPP
11+
#define BOOST_BIMAP_DETAIL_MPL_TO_MP11_LIST_HPP
12+
13+
#if defined(_MSC_VER)
14+
#pragma once
15+
#endif
16+
17+
#include <boost/mp11/list.hpp>
18+
#include <boost/mpl/begin_end.hpp>
19+
#include <boost/mpl/deref.hpp>
20+
#include <boost/mpl/next.hpp>
21+
22+
/** \struct boost::bimaps::detail::mpl_to_mp11_list
23+
24+
\brief Converts a MPL sequence to a Mp11 list
25+
26+
\code
27+
using mp11_list = mpl_to_mp11_list< mpl_sequence >;
28+
\endcode
29+
**/
30+
31+
#ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
32+
33+
namespace boost {
34+
namespace bimaps {
35+
namespace detail {
36+
37+
template< typename First, typename Last, typename... Ts >
38+
struct mpl_to_mp11_list_impl: mpl_to_mp11_list_impl
39+
<
40+
typename mpl::next<First>::type, Last,
41+
Ts..., typename mpl::deref<First>::type
42+
> {};
43+
44+
template< typename Last, typename... Ts >
45+
struct mpl_to_mp11_list_impl< Last, Last, Ts... >
46+
{
47+
using type = mp11::mp_list< Ts... >;
48+
};
49+
50+
template< typename TypeList >
51+
using mpl_to_mp11_list=typename mpl_to_mp11_list_impl
52+
<
53+
typename mpl::begin<TypeList>::type,
54+
typename mpl::end<TypeList>::type
55+
>::type;
56+
57+
} // namespace detail
58+
} // namespace bimaps
59+
} // namespace boost
60+
61+
#endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
62+
63+
#endif // BOOST_BIMAP_DETAIL_MPL_TO_MP11_LIST_HPP

0 commit comments

Comments
 (0)