Created
January 31, 2023 18:32
-
-
Save theSoberSobber/aa63132a08f30a584ec3527cb7ac276f to your computer and use it in GitHub Desktop.
my debugger
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
#include <bits/stdc++.h> | |
using namespace std; | |
#define dbg(x...) cerr << "[" << #x << "] = ["; _print(x) | |
void __print(int32_t x) {cerr << x;} | |
void __print(long x) {cerr << x;} | |
void __print(int64_t x) {cerr << x;} | |
void __print(unsigned x) {cerr << x;} | |
void __print(unsigned long x) {cerr << x;} | |
void __print(unsigned long long x) {cerr << x;} | |
void __print(float x) {cerr << x;} | |
void __print(double x) {cerr << x;} | |
void __print(long double x) {cerr << x;} | |
void __print(char x) {cerr << '\'' << x << '\'';} | |
void __print(const char *x) {cerr << '\"' << x << '\"';} | |
void __print(const string &x) {cerr << '\"' << x << '\"';} | |
void __print(bool x) {cerr << (x ? "true" : "false");} | |
template<typename T>void __print(complex<T> x) {cerr << '{'; __print(x.real()); cerr << ','; __print(x.imag()); cerr << '}';} | |
template<typename T> | |
void __print(const T &x); | |
template<typename T, typename V> | |
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';} | |
template<typename T> | |
void __print(const T &x) {int f = 0; cerr << '{'; for (auto it = x.begin() ; it != x.end() ; it++) cerr << (f++ ? "," : ""), __print(*it); cerr << "}";} | |
void _print() {cerr << "]\n";} | |
template <typename T, typename... V> | |
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment