Broom 1.0.0
A thread-local C++ Garbage Collector
Loading...
Searching...
No Matches
broom-unordered-multimap.h
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4
5#include "broom.h"
6#include "impl/broom-containers.h"
7
8#define UNORDERED_MULTIMAP_METHODS(X_) \
9 CPP11_UNORDERED_MULTIMAP_METHODS(X_) \
10 CPP14_UNORDERED_MULTIMAP_METHODS(X_) \
11 CPP17_UNORDERED_MULTIMAP_METHODS(X_) \
12 CPP20_UNORDERED_MULTIMAP_METHODS(X_) \
13 CPP23_UNORDERED_MULTIMAP_METHODS(X_)
14
15namespace broom {
28// XXX(gc): Implement via forwarding instead?
29template <typename Key, typename T, typename Hash = std::hash<Key>,
30 typename KeyEqual = std::equal_to<Key>,
31 typename Allocator = std::allocator<std::pair<const Key, T>>>
33 : private std::unordered_multimap<Key, T, Hash, KeyEqual, Allocator>,
34 public BroomValue {
35 using Base = std::unordered_multimap<Key, T, Hash, KeyEqual, Allocator>;
36
37 public:
38 DEF_TYPES()
41 : Base(il), BroomValue() {}
42 unordered_multimap(std::initializer_list<std::pair<const Key, T>> il,
43 typename Base::size_type bucket_count,
44 const Hash& hash = Hash(),
45 const KeyEqual& equal = KeyEqual(),
46 const Allocator& alloc = Allocator())
47 : Base(il, bucket_count, hash, equal, alloc), BroomValue() {}
51 for (const auto& [k, v] : *this) {
53 VISIT_HELPER(v, T);
54 }
55 }
56};
57} // namespace broom
58
59#undef UNORDERED_MULTIMAP_METHODS
60
61#include "impl/broom-undef.h"
#define UNORDERED_MULTIMAP_METHODS(X_)
virtual void Visit(Visitor *visitor) const
unordered_multimap(std::initializer_list< std::pair< const Key, T > > il, typename Base::size_type bucket_count, const Hash &hash=Hash(), const KeyEqual &equal=KeyEqual(), const Allocator &alloc=Allocator())
std::queue< T, broom::deque< T > > queue
Definition broom-queue.h:12