
c++
zgb40302
这个作者很懒,什么都没留下…
展开
-
vector<bool>与bitset的大小对比
1,#include <iostream>#include <vector>#include <bitset>using namespace std;int main(){ vector<bool> bv(63,false); bitset<63> bs; cout<<bs.size()<<" "<<sizeof(bs)<<endl; cout原创 2021-04-01 09:35:08 · 469 阅读 · 0 评论 -
cplusplus初始化顺序
1,继承的顺序;#include<iostream>using namespace std;class AAA{ public: AAA(){ cout<<"AAA"<<endl; }};class BBB{ public: BBB(){ cout<<"BBB"<<endl; }};class CCC: public BBB , AAA原创 2021-04-01 09:01:43 · 175 阅读 · 0 评论 -
remote_window_left is not enough
背景:因业务需要,客户端使用brpc , 服务器端使用 grpc c++ 1.23.0 版本,当客户端每次请求1M数据时,客户端上报remote_window_left is not enough 错误;定位手段:使用双方的helloword 例子(brpc hello client 请求 grpc hello server)测试,没有问题,怀疑server端使用特殊的启动参数。查看server 端代码:ServerBuilder builder;builder.AddLis..原创 2021-03-17 16:07:40 · 522 阅读 · 0 评论 -
几种获取本地Ip的方法
1,python: python -c 'import socket;s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM);s.connect(("www.baidu.com",0));print s.getsockname()[0]'2, dig 命令: dig +noall +answer www.baidu.com | head -n 1 | cut -d $'\t' -f 5 | xargs ip route get | he...原创 2020-08-14 16:34:46 · 230 阅读 · 0 评论 -
c++多继承虚函数内存布局
在gdb 调试中调试多继承的虚函数时,有几个总是忘记,以下做一下总结:代码:#include <iostream> using namespace std;class Destroyable {public: virtual ~Destroyable() {} virtual void Destroy() = 0;}; class ...原创 2019-12-11 16:15:04 · 386 阅读 · 0 评论