mirror of
https://github.com/morhetz/gruvbox.git
synced 2025-11-17 15:53:38 -05:00
Created _Footer (markdown)
72
_Footer.md
Normal file
72
_Footer.md
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
>
|
||||||
|
2 using namespace std;
|
||||||
|
3
|
||||||
|
4 template <typename T>
|
||||||
|
>> 5 void _dbg(char const * s, const T &t) { cout << s << "=" << t < < endl; }
|
||||||
|
6 template <typename T, typename... TA>
|
||||||
|
>> 7 void _dbg(char const *s, const T &t, const TA&... ta) { while ( *s != ',') cout << *s++; cout << "=" << t << ","; _dbg(s + 1, t a...); }
|
||||||
|
8 template <typename T1, typename T2>
|
||||||
|
>> 9 ostream& operator<<(ostream &os, const pair<T1, T2> &p) { retur n os << "{" << p.first << "," << p.second << "}"; }
|
||||||
|
10 template <typename T>
|
||||||
|
>> 11 some text added.
|
||||||
|
12 ostream& operator<<(ostream &os, const vector<T> &v) {
|
||||||
|
13 os << "{";
|
||||||
|
14 for (auto it = v.begin(); it != v.end(); ++it) {
|
||||||
|
15 if (it != v.begin()) os << ",";
|
||||||
|
16 os << *it;
|
||||||
|
17 }
|
||||||
|
18 return os << "}";
|
||||||
|
19 }
|
||||||
|
20 template <typename T1, typename T2>
|
||||||
|
>> 21 ostream& operator<<(ostream &os, const map<T1, T2> &mp) {
|
||||||
|
22 os << "{";
|
||||||
|
23 for (auto it = mp.begin(); it != mp.end(); ++it) {
|
||||||
|
24 if (it != mp.begin()) os << ",";
|
||||||
|
25 os << *it;
|
||||||
|
26 }
|
||||||
|
27 return os << "}";
|
||||||
|
28 }
|
||||||
|
29 template <typename T>
|
||||||
|
>> 30 ostream& operator<<(ostream &os, const set<T> &s) {
|
||||||
|
31 os << "{";
|
||||||
|
32 for (auto it = s.begin(); it != s.end(); ++it) {
|
||||||
|
33 if (it != s.begin()) os << ",";
|
||||||
|
34 os << *it;
|
||||||
|
35 }
|
||||||
|
36 return os << "}";
|
||||||
|
37 }
|
||||||
|
38 template <typename T>
|
||||||
|
39 ostream& operator<<(ostream &os, const multiset<T> &s) {
|
||||||
|
40 os << "{";
|
||||||
|
41 for (auto it = s.begin(); it != s.end(); ++it) {
|
||||||
|
42 if (it != s.begin()) os << ",";
|
||||||
|
43 os << *it;
|
||||||
|
44 }
|
||||||
|
45 return os << "}";
|
||||||
|
46 }
|
||||||
|
47 template <size_t N>
|
||||||
|
48 ostream& operator<<(ostream &os, const bitset<N> &bs) {
|
||||||
|
49 os << "{";
|
||||||
|
50 for (size_t i = 0; i < N; ++i) {
|
||||||
|
51 cout << bs[i];
|
||||||
|
52 }
|
||||||
|
53 return os << "}";
|
||||||
|
54 }
|
||||||
|
55
|
||||||
|
56 #ifdef LOCAL
|
||||||
|
57 #define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
|
||||||
|
58 #else
|
||||||
|
59 #define dbg(...)
|
||||||
|
60 #endif
|
||||||
|
61
|
||||||
|
62 #define all(x) (x).begin(), (x).end()
|
||||||
|
63 #define rall(x) (x).rbegin(), (x).rend()
|
||||||
|
64 #define reunique(x) (x).resize(std::unique(all(x)) - (x).begin( ))
|
||||||
|
65 using ll = long long;
|
||||||
|
66 using ld = long double;
|
||||||
|
67 using pii = pair<int, int>;
|
||||||
|
68 using pll = pair<ll, ll>;
|
||||||
|
69 using pdd = pair<ld, ld>;
|
||||||
|
70
|
||||||
|
71 struct Ev {
|
||||||
|
72 int x;
|
||||||
Reference in New Issue
Block a user