Vcsn
2.0
Be Rational
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
echo.hh
Go to the documentation of this file.
1
#ifndef VCSN_MISC_ECHO_HH
2
# define VCSN_MISC_ECHO_HH
3
4
# include <iostream>
5
# include <set>
6
# include <vector>
7
9
# define V(S) \
10
#S ": " << S << ' '
11
13
# define VV(S) \
14
"<" #S ":" __HERE__ << '>' << S << "</" << #S << '>'
15
16
# define SHOW(S) std::cerr << S << std::endl
17
18
# define SHOWV(S) SHOW(V(S))
19
20
# define __HERE__ __FILE__ ": " << __LINE__
21
22
# define SHOWH(S) SHOW(__HERE__ << ": " << S)
23
24
namespace
std
25
{
26
template
<
typename
T>
27
ostream&
28
operator<<(ostream& o, set<T>& ts)
29
{
30
bool
first =
true
;
31
for
(
const
auto
& t: ts)
32
{
33
if
(!first)
34
o <<
' '
;
35
o << t;
36
first =
false
;
37
}
38
return
o;
39
}
40
41
template
<
typename
T>
42
ostream&
43
operator<<(ostream& o, vector<T>& ts)
44
{
45
bool
first =
true
;
46
for
(
const
auto
& t: ts)
47
{
48
if
(!first)
49
o <<
' '
;
50
o << t;
51
first =
false
;
52
}
53
return
o;
54
}
55
}
56
57
#endif // !VCSN_MISC_ECHO_HH
vcsn
misc
echo.hh
Generated by
1.8.7