mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-15 07:46:56 +02:00
multi_index: fix compilation failure with boost >= 1.91
This effectively revertsa3cb309e7cfrom PR #30194. That PR reduced the multi_index type signatures as recommended upstream, but this is no longer supported as of boost 1.91 because it is no longer necessary. 1.91 drops support for the pre-c++11 work-arounds that bloated the type signatures to begin with. The upstream `BOOST_MULTI_INDEX_ENABLE_MPL_SUPPORT` define is meant to provide compatibility with removed features, but it does not work for this case. Using `indexed_by` directly when defining the `multi_index` (as opposed to inheriting from it) works with all versions, and avoids the use of the back-compat define. This is a slight regression when building against boost < 1.91 because the bloated type signatures are reintroduced in that case, but it's not significant enough to go to the trouble of introducing version detection and ifdefs. Github-Pull: #35175 Rebased-From:0bc9d354df
This commit is contained in:
@@ -109,7 +109,9 @@ struct CompareTxIterByAncestorCount {
|
||||
};
|
||||
|
||||
|
||||
struct CTxMemPoolModifiedEntry_Indices final : boost::multi_index::indexed_by<
|
||||
using indexed_modified_transaction_set = boost::multi_index_container<
|
||||
CTxMemPoolModifiedEntry,
|
||||
boost::multi_index::indexed_by<
|
||||
boost::multi_index::ordered_unique<
|
||||
modifiedentry_iter,
|
||||
CompareCTxMemPoolIter
|
||||
@@ -122,12 +124,7 @@ struct CTxMemPoolModifiedEntry_Indices final : boost::multi_index::indexed_by<
|
||||
CompareTxMemPoolEntryByAncestorFee
|
||||
>
|
||||
>
|
||||
{};
|
||||
|
||||
typedef boost::multi_index_container<
|
||||
CTxMemPoolModifiedEntry,
|
||||
CTxMemPoolModifiedEntry_Indices
|
||||
> indexed_modified_transaction_set;
|
||||
>;
|
||||
|
||||
typedef indexed_modified_transaction_set::nth_index<0>::type::iterator modtxiter;
|
||||
typedef indexed_modified_transaction_set::index<ancestor_score>::type::iterator modtxscoreiter;
|
||||
|
||||
@@ -91,12 +91,13 @@ class TxOrphanageImpl final : public TxOrphanage {
|
||||
}
|
||||
};
|
||||
|
||||
struct OrphanIndices final : boost::multi_index::indexed_by<
|
||||
boost::multi_index::ordered_unique<boost::multi_index::tag<ByWtxid>, WtxidExtractor>,
|
||||
boost::multi_index::ordered_unique<boost::multi_index::tag<ByPeer>, ByPeerViewExtractor>
|
||||
>{};
|
||||
|
||||
using AnnouncementMap = boost::multi_index::multi_index_container<Announcement, OrphanIndices>;
|
||||
using AnnouncementMap = boost::multi_index::multi_index_container<
|
||||
Announcement,
|
||||
boost::multi_index::indexed_by<
|
||||
boost::multi_index::ordered_unique<boost::multi_index::tag<ByWtxid>, WtxidExtractor>,
|
||||
boost::multi_index::ordered_unique<boost::multi_index::tag<ByPeer>, ByPeerViewExtractor>
|
||||
>
|
||||
>;
|
||||
template<typename Tag>
|
||||
using Iter = typename AnnouncementMap::index<Tag>::type::iterator;
|
||||
AnnouncementMap m_orphans;
|
||||
|
||||
Reference in New Issue
Block a user