Create comparator wrapper classes for MSVC 2019 build issues:

* The std::less and std::equal_to comparators have [[nodiscard]], which
  conflicts with boost::bimap validations.
This commit is contained in:
Edward Hennis
2021-03-05 13:29:17 -05:00
committed by manojsdoshi
parent 9932a19139
commit ab9039e77d
3 changed files with 86 additions and 3 deletions

View File

@@ -21,6 +21,7 @@
#include <ripple/basics/UnorderedContainers.h>
#include <ripple/basics/chrono.h>
#include <ripple/basics/comparators.h>
#include <ripple/basics/tagged_integer.h>
#include <ripple/consensus/LedgerTiming.h>
#include <ripple/json/json_value.h>
@@ -242,7 +243,9 @@ private:
*/
class LedgerOracle
{
using InstanceMap = boost::bimaps::bimap<Ledger::Instance, Ledger::ID>;
using InstanceMap = boost::bimaps::bimap<
boost::bimaps::set_of<Ledger::Instance, ripple::less<Ledger::Instance>>,
boost::bimaps::set_of<Ledger::ID, ripple::less<Ledger::ID>>>;
using InstanceEntry = InstanceMap::value_type;
// Set of all known ledgers; note this is never pruned