tlx
Loading...
Searching...
No Matches
unordered_set.hpp
Go to the documentation of this file.
1
/*******************************************************************************
2
* tlx/logger/unordered_set.hpp
3
*
4
* Part of tlx - http://panthema.net/tlx
5
*
6
* Copyright (C) 2018 Timo Bingmann <tb@panthema.net>
7
*
8
* All rights reserved. Published under the Boost Software License, Version 1.0
9
******************************************************************************/
10
11
#ifndef TLX_LOGGER_UNORDERED_SET_HEADER
12
#define TLX_LOGGER_UNORDERED_SET_HEADER
13
14
#include <
tlx/logger/core.hpp
>
15
16
#include <unordered_set>
17
18
namespace
tlx
{
19
20
template
<
typename
T,
typename
H,
typename
E,
typename
A>
21
class
LoggerFormatter
<
std
::unordered_set<T, H, E, A> >
22
{
23
public
:
24
static
void
print
(std::ostream& os,
25
const
std::unordered_set<T, H, E, A>& data) {
26
os <<
'{'
;
27
for
(
typename
std::unordered_set<T, H, E, A>::const_iterator
28
it = data.begin(); it != data.end(); ++it)
29
{
30
if
(it != data.begin()) os <<
','
;
31
LoggerFormatter<T>::print
(os, *it);
32
}
33
os <<
'}'
;
34
}
35
};
36
37
template
<
typename
T,
typename
H,
typename
E,
typename
A>
38
class
LoggerFormatter
<
std
::unordered_multiset<T, H, E, A> >
39
{
40
public
:
41
static
void
print
(std::ostream& os,
42
const
std::unordered_multiset<T, H, E, A>& data) {
43
os <<
'{'
;
44
for
(
typename
std::unordered_multiset<T, H, E, A>::const_iterator
45
it = data.begin(); it != data.end(); ++it)
46
{
47
if
(it != data.begin()) os <<
','
;
48
LoggerFormatter<T>::print
(os, *it);
49
}
50
os <<
'}'
;
51
}
52
};
53
54
}
// namespace tlx
55
56
#endif
// !TLX_LOGGER_UNORDERED_SET_HEADER
57
58
/******************************************************************************/
tlx::LoggerFormatter< std::unordered_multiset< T, H, E, A > >::print
static void print(std::ostream &os, const std::unordered_multiset< T, H, E, A > &data)
Definition
unordered_set.hpp:41
tlx::LoggerFormatter< std::unordered_set< T, H, E, A > >::print
static void print(std::ostream &os, const std::unordered_set< T, H, E, A > &data)
Definition
unordered_set.hpp:24
tlx::LoggerFormatter
template class for formatting. contains a print() method.
Definition
core.hpp:25
core.hpp
std
STL namespace.
tlx
Definition
exclusive_scan.hpp:17
tlx
logger
unordered_set.hpp
Generated on Sat Jul 20 2024 00:00:00 for tlx by
1.11.0