Broom
1.0.0
A thread-local C++ Garbage Collector
Loading...
Searching...
No Matches
include
broom-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 MULTIMAP_METHODS(X_) \
9
CPP11_MULTIMAP_METHODS(X_) \
10
CPP14_MULTIMAP_METHODS(X_) \
11
CPP17_MULTIMAP_METHODS(X_) \
12
CPP20_MULTIMAP_METHODS(X_) \
13
CPP23_MULTIMAP_METHODS(X_)
14
15
namespace
broom
{
27
// XXX(gc): Implement via forwarding instead?
28
template
<
typename
Key,
typename
T,
typename
Compare = std::less<Key>,
29
typename
Allocator = std::allocator<std::pair<const Key, T>>>
30
class
multimap
:
private
std::multimap<Key, T, Compare, Allocator>,
31
public
BroomValue
{
32
using
Base = std::multimap<Key, T, Compare, Allocator>;
33
34
public
:
35
DEF_TYPES()
36
DEF_CONSTRUCTOR
(
multimap
)
37
multimap
(std::
initializer_list
<std::
pair
<
const
Key
, T>>
il
,
38
const
Compare
&
comp
=
Compare
(),
39
const
Allocator
&
alloc
=
Allocator
())
40
: Base(
il
,
comp
,
alloc
),
BroomValue
() {}
41
DEF_METHODS
(
multimap
)
42
MULTIMAP_METHODS
(
USE_METHODS
)
43
virtual
void
Visit
(
Visitor
*
visitor
)
const
{
44
for
(
const
auto
& [
k
,
v
] : *
this
) {
45
VISIT_HELPER
(
k
,
Key
);
46
VISIT_HELPER
(
v
, T);
47
}
48
}
49
};
50
}
// namespace broom
51
52
#undef MULTIMAP_METHODS
53
54
#include "impl/broom-undef.h"
MULTIMAP_METHODS
#define MULTIMAP_METHODS(X_)
Definition
broom-multimap.h:8
broom.h
broom::Allocator
Definition
allocator.h:235
broom::BroomValue
Definition
broom.h:402
broom::Visitor
Definition
broom.h:353
broom::multimap
Definition
broom-multimap.h:31
broom::multimap::Visit
virtual void Visit(Visitor *visitor) const
Definition
broom-multimap.h:43
broom
Definition
allocator-inl.h:9
broom::queue
std::queue< T, broom::deque< T > > queue
Definition
broom-queue.h:12
Generated by
1.9.8