157 Commits

Author SHA1 Message Date
René Ferdinand Rivera Morell
60ff77c181
Add support for modular build structure. (#73)
* Make the library modular usable.

* Put back removing qualified boostcpp tag. As we need it until the Jamroot removes the qualified tag.

* Switch to library requirements instead of source. As source puts extra source in install targets.

* Remove uses of BOOST_ROOT in Jamfiles.

* Add requires-b2 check to top-level build file.

* Bump B2 require to 5.2

* Update copyright dates.

* Move inter-lib dependencies to a project variable and into the build targets.

* Update build deps.
2024-10-12 09:18:24 +02:00
joaquintides
3ad3171006 removed unneeded typename 2023-05-21 11:58:47 +02:00
joaquintides
f8143b9ff9 fixed #68 2023-05-21 11:39:44 +02:00
joaquintides
6163f59747 editorial, extended test_iterators 2023-03-01 09:52:07 +01:00
Christian Mazakas
28e00a0ea6 Add small test proving Boost.Foreach compatibility 2023-02-28 08:20:18 -08:00
joaquintides
c42c2509bc removed header-level dependency from Boost.Serialization 2023-02-26 19:16:45 +01:00
joaquintides
fba66b0538 updated dates and release notes 2022-04-08 17:13:04 +02:00
Michael Ford
a7e5cf843a
refactor use core/ref.hpp over ref.hpp (#58)
The later has been deprecated:
```cpp

// The header file at this path is deprecated;
// use boost/core/ref.hpp instead.

```
2022-04-08 17:05:47 +02:00
joaquintides
7c591a13aa
improved performance of count in ranked indices (#56)
* count for ranked_index uses rank

Normally, count is calculated as the distance between iterators,
which takes linear time when count(x,comp) is comparable with n,
but for ranked indices we can subtract the values or rank,
reducing the complexity from log(n)+count(x,comp) to log(n).

* Added test for new count(x) and count(x,comp) in ranked_index

Both, the existing implementation of count from ordered_index and
the new implementation for ranked_index are compared with the
common sense. Positive results of this test show in particular that
the numbers produced by the new implementation are consistent with
those from the existing implementation and hence correct.

* Benchmark of count(): ordered_index vs ranked_index

A benchmark is added as count_benchmark.cpp in the 'example'
directory.

When the values of an index are unique, both implementations are
comparable (ranked_index is 10-15% faster).

However, for highly non-unique indices (like the age of people),
the new implementation in ranked_index outperforms ordered_index.
For 1 000 people of age in 0..99 ranked_index is ~2x faster,
for 10 000 people it is 12-13x faster, and
for 100 000 people it is 95-100x times faster.

For even more non-unique indices (like sex or the age of pupils)
or coarse comparison predicates (grouping people in age groups
like 0..9, 10..19 etc.) the gap in performance grows further.
For a comparison predicate comparing 'age/10' for age in 0..99,
similar gaps in performance occur already for 10x smaller
containers:
for 100 people count in ranked_index is 2x faster,
for 1 000 people it is ~9x faster,
for 10 000 people it is 95-100x faster,
for 100 000 people it is almost 1000x faster.

* Documentation updated with new complexity of count in ranked_index

* simplified Damian's contribution

* reorganized code

* covered ranked_index::count

* updated docs

Co-authored-by: DamianSawicki <86234282+DamianSawicki@users.noreply.github.com>
2022-02-05 12:59:43 +01:00
joaquintides
0179c2c041 suppressed spurious GCC type-limits warnings 2021-08-28 10:52:28 +02:00
joaquintides
a52810fc3d
implemented merge operations (#49)
* initial draft

* modified appveyor.yml for this branch

* dropped BOOST_RV_REF
as it doesn't handle lvalue refs

* befriended index_base from all indices
so as to be grant access to final_extract_for_merge_ from an external container

* added rvalue ref merge
(test expected to fail in C++03)

* added explicit boost::move on rvalue ref
for the benefit of C++03 compilers

* fixed previous workaround

* refactored merge algorithm into multi_index_container

* added hashed_index::merge

* reimplemented sequenced_index::splice(position,x)

* added missing this->'s

* refactored SFINAEing code

* made sequenced_index::splice(position,x) exception robust

* reimplemented random_access_index::splice(position,x)

* micro-optimized legacy code in random_access_index::splice(position,x)

* added missing #include

* reimplemented sequenced_index::splice(position,x,i)

* reimplemented random_access_index::splice(position,x,i)

* reimplemented sequenced_index::splice(position,x,first,last)

* reimplemented random_access_index::splice(position,x,first,last)

* re-engineered sequenced_index::splice(position,x,i)
so that it works when source and destination belong to the same container

* stylistic

* re-engineered random_access_index::splice(position,x,i)
so that it works when source and destination belong to the same container

* re-engineered sequenced_index::splice(position,x,first,last)
so that it works when source and destination belong to the same container

* stylistic

* fixed bug in rvalue ref overload of sequenced_index::splice(position,x,first,last)

* fixed internal sequenced_index::splice(position,x,first,last) across different indices

* re-engineered random_access_index::splice(position,x,first,last)
the same way as done with sequenced_index

* replaced multi_index_container::merge_ with transfer_range_
so as to refactor some code in non-key-based indices

* fixed safe mode check for different-type containers

* hardened merge/splice tests

* s/BOOST_RV_REF/BOOST_FWD_REF

* called the right merge_different overload

* fixed problem with Boost.Move C++03 perfect fwd emulation

* updated (C) year

* allowed intra-container full splice

* required position==end() in intra-container full splice

* made pointwise splice return a pair<iterator,bool>

* added partial merge functionality to key-based indices
plus fixed a compile-time error with legacy splice code when applied to different-type indices

* suppressed unused variable

* fixed wrong signature in splice memfun

* made safe-mode iterators SCARY

* refactored any_container_view

* implemented safe iterator transfer in merge/splice

* reorganized internal deps

* stylistic

* automatically checked iterator invalidation upon merge/splice

* removed commented-out code

* checked allocator equality

* reimplemented random_access_index internal, cross-index splice in linear time

* updated docs

* reverted appveyor.yml
2021-08-19 10:41:03 +02:00
joaquintides
5623d2b9e2 added contains (#35) 2021-07-29 12:04:15 +02:00
joaquintides
3dad7f38a4 fixed #45 2021-07-08 19:41:40 +02:00
joaquintides
b685e11dfc stopped relying on stdlib function objects' ::result_type 2020-06-29 11:51:24 +02:00
joaquintides
ece90a6eb4 un-named unused parameter 2020-05-11 15:37:17 +02:00
joaquintides
2271c1b9c6 added missing typename keyword 2020-05-10 12:26:17 +02:00
joaquintides
4a109e99e5 avoided deprecated #includes, fixed Boost.Move headers 2020-05-10 12:17:55 +02:00
joaquintides
f8945d113e fixed interaction of C++03 boost::move with non-refd template params 2020-05-10 11:50:06 +02:00
joaquintides
85b6cdba91 SFINAEd test overload set 2020-05-10 11:01:50 +02:00
joaquintides
98091f99e6 added missing typename keyword 2020-05-10 10:12:17 +02:00
joaquintides
e69466039d implemented node extraction/insertion (#27) 2020-05-09 20:25:41 +02:00
joaquintides
1c3ef66798 stopped #including deprecated <boost/bind.hpp> 2020-02-17 09:39:08 +01:00
joaquintides
61c732118e refactored rooted_allocator 2020-01-27 12:33:02 +01:00
joaquintides
81dbe86f25 suppressed VS warnings 2020-01-26 13:24:55 +01:00
joaquintides
3e8928834c fixed allocator awareness test for move assignment 2020-01-26 12:59:37 +01:00
joaquintides
adbb136e43 completed Boost.Move support for move_tracker 2020-01-26 12:40:35 +01:00
joaquintides
ff46d35312 enabled Boost.Move support for move_tracker 2020-01-26 12:16:54 +01:00
joaquintides
a8d34a56f7 made multi_index_container AllocatorAware (#30) 2020-01-26 11:52:23 +01:00
joaquintides
89b4ff7bbf abode by [depr.impldec] 2020-01-21 15:04:21 +01:00
joaquintides
e49ae2b4c2 handled volatile/ref-qualified/noexcept memfun key extraction (#24) 2019-06-09 17:32:46 +02:00
joaquintides
6698843328 avoided self-assign-overloaded Clang warnings 2018-12-31 12:54:27 +01:00
joaquintides
dc1ac9d879 added/trimmed #include's 2018-12-31 10:59:06 +01:00
joaquintides
255a53240d silenced MSVC patronizing warnings 2018-12-30 16:35:05 +01:00
joaquintides
a199da8fb0 reverted ec129437dc3bf4d05649ee7a86bcf94b2800affa as useless 2018-12-30 16:32:35 +01:00
joaquintides
c57a6771fd refactored 91f21167118564daedafb0224132f7b2b6651e05 2018-12-30 14:59:14 +01:00
joaquintides
9acee043bc disabled MSVC 14.0 warning 2018-12-30 12:13:32 +01:00
joaquintides
ec129437dc bypassed MSVC 12.0 bogus errors 2018-12-29 22:42:51 +01:00
joaquintides
d9c62ea8ed shut down "unsigned>=0"-type tautological-compare Clang warnings 2018-12-29 21:33:28 +01:00
joaquintides
18cea285e2 inherited size_type and difference_type from the allocator 2018-12-29 13:06:57 +01:00
joaquintides
d6cd661119 renamed file 2018-09-03 09:25:51 +02:00
joaquintides
c1889e33dc re-made test_key pass when !defined(BOOST_MULTI_INDEX_KEY_SUPPORTED) for the sake of test_all_main.cpp 2018-09-02 12:20:36 +02:00
joaquintides
cfbf3f6fdc made test_key build conditional 2018-09-02 12:08:38 +02:00
joaquintides
e86162cff8 made warn instead of fail when key is not supported 2018-08-30 11:27:53 +02:00
joaquintides
35ba93a0eb avoided std::*[_t|_v] to extend compiler support 2018-08-20 10:08:41 +02:00
joaquintides
135b31fc3c fixed use of BOOST_MULTI_INDEX_KEY_SUPPORTED 2018-08-18 18:51:21 +02:00
joaquintides
e8c1598e32 temporarily enabled test_key everywhere 2018-08-18 12:46:54 +02:00
joaquintides
72d4b74cfb attended expansion of key<> support to MSVC 2018-08-18 12:46:30 +02:00
joaquintides
0ac225601d detabbed 2018-08-17 13:16:39 +02:00
joaquintides
7cc508376c introduced C++17 terse key specification syntax 2018-08-17 13:07:53 +02:00
joaquintides
7b77621323 avoided Boost.Move use for the sake of old GCC versions 2018-04-20 10:51:06 +02:00