LLVM 20.0.0git
Static Public Member Functions | List of all members
llvm::SparseSetValTraits< ValueT > Struct Template Reference

SparseSetValTraits - Objects in a SparseSet are identified by keys that can be uniquely converted to a small integer less than the set's universe. More...

#include "llvm/ADT/SparseSet.h"

Static Public Member Functions

static unsigned getValIndex (const ValueT &Val)
 

Detailed Description

template<typename ValueT>
struct llvm::SparseSetValTraits< ValueT >

SparseSetValTraits - Objects in a SparseSet are identified by keys that can be uniquely converted to a small integer less than the set's universe.

This class allows the set to hold values that differ from the set's key type as long as an index can still be derived from the value. SparseSet never directly compares ValueT, only their indices, so it can map keys to arbitrary values. SparseSetValTraits computes the index from the value object. To compute the index from a key, SparseSet uses a separate KeyFunctorT template argument.

A simple type declaration, SparseSet<Type>, handles these cases:

The type declaration SparseSet<Type, UnaryFunction> handles:

Only other, unexpected cases require specializing SparseSetValTraits.

For best results, ValueT should not require a destructor.

Definition at line 57 of file SparseSet.h.

Member Function Documentation

◆ getValIndex()

template<typename ValueT >
static unsigned llvm::SparseSetValTraits< ValueT >::getValIndex ( const ValueT Val)
inlinestatic

The documentation for this struct was generated from the following file: