14#ifndef WPIUTIL_WPI_DENSEMAPINFOVARIANT_H
15#define WPIUTIL_WPI_DENSEMAPINFOVARIANT_H
26 using FirstT = std::variant_alternative_t<0, Variant>;
33 return Variant(std::in_place_index<0>,
39 [&Val](
auto &&Alternative) {
40 using T = std::decay_t<
decltype(Alternative)>;
44 Val.index(), Alternative);
50 if (LHS.index() != RHS.index())
52 if (LHS.valueless_by_exception())
57 const void *ErasedLHS =
58 std::visit([](
const auto &LHS) ->
const void * {
return &LHS; }, LHS);
60 [&](
const auto &RHS) ->
bool {
61 using T = std::remove_cv_t<std::remove_reference_t<
decltype(RHS)>>;
This file defines DenseMapInfo traits for DenseMap.
Implement std::hash so that hash_code can be used in STL containers.
Definition PointerIntPair.h:280
Foonathan namespace.
Definition ntcore_cpp.h:26
std::variant< Ts... > Variant
Definition DenseMapInfoVariant.h:25
static Variant getTombstoneKey()
Definition DenseMapInfoVariant.h:32
std::variant_alternative_t< 0, Variant > FirstT
Definition DenseMapInfoVariant.h:26
static Variant getEmptyKey()
Definition DenseMapInfoVariant.h:28
static bool isEqual(const Variant &LHS, const Variant &RHS)
Definition DenseMapInfoVariant.h:49
static unsigned getHashValue(const Variant &Val)
Definition DenseMapInfoVariant.h:37
An information struct used to provide DenseMap with the various necessary components for a given valu...
Definition Hashing.h:65