这个库花了我好多心思,功能个人感觉是挺不错的
这是示例代码
#include "debug.hpp"
#include <bits/stdc++.h>
int main() {
std::cout << "=========Without type=========" << std::endl;
std::vector<std::string> strs {"Hello", ",", " world!"};
debug(strs);
std::tuple<int, double, std::vector<std::string>> tup(114514, 3.1415926535897, strs);
debug(tup);
std::map<std::string, int> m { {"China", 1}, {"America", 2}, {"Russia", 3} };
debug(m);
bool ok = true;
debug(ok);
std::cout << "==============================" << std::endl;
std::cout << std::endl;
std::cout << "=========With type=========" << std::endl;
debug_with_type(strs);
debug_with_type(tup);
debug_with_type(m);
debug_with_type(ok);
std::cout << "==============================" << std::endl;
}
下面是输出
=========Without type=========
strs = ["Hello", ",", " world!"]
tup = (114514, 3.1415926535897, ["Hello", ",", " world!"])
m = {"America": 2, "China": 1, "Russia": 3}
ok = true
==============================
=========With type=========
std::vector<std::string> strs = ["Hello", ",", " world!"]
std::tuple<int, double, std::vector<std::string>> tup = (114514, 3.1415926535897, ["Hello", ",", " world!"])
std::map<std::string, int> m = {"America": 2, "China": 1, "Russia": 3}
bool ok = true
==============================
如果觉得好用的话不妨为我留下个star哦!详细的信息在仓库介绍里面
如果有问题也可以在github上给我提issue,我会第一时间处理的~