mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 07:20:10 +01:00
aco/util: Add aco::unordered_set
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38281>
This commit is contained in:
parent
0cfabe0613
commit
93a5919cee
1 changed files with 9 additions and 0 deletions
|
|
@ -21,6 +21,7 @@
|
|||
#include <memory>
|
||||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
namespace aco {
|
||||
|
|
@ -391,6 +392,14 @@ template <class Key, class T, class Hash = std::hash<Key>, class Pred = std::equ
|
|||
using unordered_map =
|
||||
std::unordered_map<Key, T, Hash, Pred, aco::monotonic_allocator<std::pair<const Key, T>>>;
|
||||
|
||||
/*
|
||||
* aco::unordered_set - alias for std::unordered_set with monotonic_allocator
|
||||
*
|
||||
* This template specialization mimics std::pmr::unordered_set.
|
||||
*/
|
||||
template <class T, class Hash = std::hash<T>, class Pred = std::equal_to<T>>
|
||||
using unordered_set = std::unordered_set<T, Hash, Pred, aco::monotonic_allocator<T>>;
|
||||
|
||||
/*
|
||||
* Cache-friendly set of 32-bit IDs with fast insert/erase/lookup and
|
||||
* the ability to efficiently iterate over contained elements.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue