随笔分类 -  CPP

摘要:编译选项 -g -rdynamic #include <execinfo.h> void print_stacktrace() { void *buffer[100]; int nptrs = backtrace(buffer, 100); char **strings = backtrace_sy 阅读全文
posted @ 2023-01-13 15:25 马肯尼煤牙巴骨 阅读(219) 评论(0) 推荐(0) 编辑
摘要:#安装 valgrind sudo apt-get install valgrind #使用 memcheck 打开程序 valgrind --tool=memcheck myprogram [args...] 阅读全文
posted @ 2022-12-29 15:10 马肯尼煤牙巴骨 阅读(33) 评论(0) 推荐(0) 编辑
摘要:#if defined(__GNUC__) && __GNUC__ < 7 # include <experimental/string_view> # include <experimental/optional> # define string_view experimental::string 阅读全文
posted @ 2022-12-02 17:42 马肯尼煤牙巴骨 阅读(54) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <string_view> template<typename T> struct TypeName { constexpr static std::string_view fullname_intern() { #if defined(__ 阅读全文
posted @ 2022-11-25 13:44 马肯尼煤牙巴骨 阅读(54) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> template<class derived> struct base { derived getDerivedType(){}; void interface(){ static_cast<derived*>(this)->interface();}; }; 阅读全文
posted @ 2022-11-16 19:17 马肯尼煤牙巴骨 阅读(27) 评论(0) 推荐(0) 编辑
摘要:# We'll use defaults Microsoft from the LLVM style, but with 4 columns indentation. BasedOnStyle: Microsoft IndentWidth: 4 ColumnLimit: 0 Language: Cp 阅读全文
posted @ 2022-05-20 00:37 马肯尼煤牙巴骨 阅读(24) 评论(0) 推荐(0) 编辑
摘要:![](https://img2020.cnblogs.com/blog/1251880/202105/1251880-20210523142834149-974820415.png) 阅读全文
posted @ 2021-05-23 14:28 马肯尼煤牙巴骨 阅读(33) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <string> #include <locale> #include <codecvt> std::wstring s2ws(const std::string& str) { using convert_typeX = std::code 阅读全文
posted @ 2021-05-23 13:51 马肯尼煤牙巴骨 阅读(427) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示