摘要:
使用std::thread 创建线程, 代码逻辑如果存在某些异常,。这时候程序会产生coredump, 但是分析coredump, 会发现调用栈是缺失的,造成定位问题困难; 问题描述: 源码: 1 #include <stdexcept> 2 #include <thread> 3 #include 阅读全文
摘要:
转自: http://www.cppblog.com/zgysx/archive/2007/03/12/19662.html C++中的重载(Overload), 覆盖(Override)和隐藏(Hide)写正题之前,先给出几个关键字的中英文对照,重载(overload),覆盖(override), 阅读全文
摘要:
1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<string.h> 4 #include<errno.h> 5 #include<sys/types.h> 6 #include<sys/socket.h> 7 #include<unistd.h 阅读全文
摘要:
在编写代码的时候,发现一个现象: 模板类从一个父模板类继承后,不能访问其内部的protected成员变量,提示:not declare; 普通类从一个父模板类继承后,可以访问其内部的protected成员变量,可正常编译和使用; 对于第1个现象,如果想正常使用需要加上父模板类的域名; 下面上代码 模 阅读全文
摘要:
先上图 阅读全文
摘要:
xx.cpp中包含头文件的次序如下: xx.h C 系统文件 C++ 系统文件 其他库的 .h 文件 本项目内 .h 文件 阅读全文
摘要:
1) brpc/channel.cpp int Channel::Init(const char* ns_url, const char* lb_name, const ChannelOptions* options) 2) brpc/load_balancer_with_naming.cpp in 阅读全文
摘要:
1,error: template declaration of 'typedef' typedef std::function<void(Input begin> My_Func 解决方案: template <typename Input> using My_Func= std::functio 阅读全文