|
20 | 20 | #ifndef LLVM_ADT_SPARSESET_H |
21 | 21 | #define LLVM_ADT_SPARSESET_H |
22 | 22 |
|
| 23 | +#include "llvm/ADT/STLForwardCompat.h" |
23 | 24 | #include "llvm/ADT/SmallVector.h" |
24 | | -#include "llvm/ADT/identity.h" |
25 | 25 | #include "llvm/Support/AllocatorBase.h" |
26 | 26 | #include <cassert> |
27 | 27 | #include <cstdint> |
@@ -112,16 +112,16 @@ struct SparseSetValFunctor<KeyT, KeyT, KeyFunctorT> { |
112 | 112 | /// uint16_t or uint32_t. |
113 | 113 | /// |
114 | 114 | /// @tparam ValueT The type of objects in the set. |
| 115 | +/// @tparam KeyT The type of the key, which is passed to the key functor. |
115 | 116 | /// @tparam KeyFunctorT A functor that computes an unsigned index from KeyT. |
116 | 117 | /// @tparam SparseT An unsigned integer type. See above. |
117 | 118 | /// |
118 | | -template <typename ValueT, typename KeyFunctorT = identity<unsigned>, |
119 | | - typename SparseT = uint8_t> |
| 119 | +template <typename ValueT, typename KeyT = unsigned, |
| 120 | + typename KeyFunctorT = identity_cxx20, typename SparseT = uint8_t> |
120 | 121 | class SparseSet { |
121 | 122 | static_assert(std::is_unsigned_v<SparseT>, |
122 | 123 | "SparseT must be an unsigned integer type"); |
123 | 124 |
|
124 | | - using KeyT = typename KeyFunctorT::argument_type; |
125 | 125 | using DenseT = SmallVector<ValueT, 8>; |
126 | 126 | using size_type = unsigned; |
127 | 127 | DenseT Dense; |
|
0 commit comments