forked from oToToT/kiseki
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c506dcc
commit 6faadd6
Showing
1 changed file
with
15 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
#define all(x) begin(x), end(x) | ||
#ifdef CKISEKI | ||
#ifdef local | ||
#define safe cerr<<__PRETTY_FUNCTION__<<" line "<<__LINE__<<" safe\n" | ||
#define debug(a...) debug_(#a, a) | ||
#define orange(a...) orange_(#a, a) | ||
template <typename ...T> | ||
void debug_(const char *s, T ...a) { | ||
cerr << "\e[1;32m(" << s << ") = ("; | ||
int cnt = sizeof...(T); | ||
(..., (cerr << a << (--cnt ? ", " : ")\e[0m\n"))); | ||
#define debug(a...) \ | ||
cerr<<"\e[1;32m("#a") = ("<<debug_(a)<<")\e[0m\n" | ||
#define orange(a...) \ | ||
orange_("\e[1;32m[ "#a" ] = [ ", a, " ]\e[0m\n") | ||
template <typename T> | ||
string debug_(T t) { return to_string(t); } | ||
template <typename U, typename ...V> | ||
string debug_(U u, V ...v) { | ||
return to_string(u) + ", " + debug_(v...); | ||
} | ||
template <typename I> | ||
void orange_(const char *s, I L, I R) { | ||
cerr << "\e[1;32m[ " << s << " ] = [ "; | ||
for (int f = 0; L != R; ++L) | ||
cerr << (f++ ? ", " : "") << *L; | ||
cerr << " ]\e[0m\n"; | ||
void orange_(string pre, I L, I R, string post) { | ||
cerr << pre; | ||
copy(L, R, ostream_iterator<decltype(*L)>(cerr, ", ")); | ||
cerr << post; | ||
} | ||
#else | ||
#define safe ((void)0) | ||
#define debug(...) safe | ||
#define orange(...) safe | ||
#endif | ||
|