Loading

上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 76 下一页
摘要: 问题 vector使用emplace_back()无法添加元素,使用push_back()却可以。 难道emplace_back()与列表初始化不兼容?非也! 复现 代码片段 std::vector<std::array<int, 4> > vec; vec.emplace_back({1,2,3, 阅读全文
posted @ 2022-05-09 20:46 azureology 阅读(1136) 评论(0) 推荐(2)
摘要: 问题 C++报错undefined reference to vtable XXXClass::xxFunction 解决 通常是基类中声明了纯虚函数且在外部存在调用,仔细检查基类头文件是否遗漏 virtual void ParseFlag(const uint8_t&) = 0; 这里一定要显式写 阅读全文
posted @ 2022-05-09 14:49 azureology 阅读(744) 评论(0) 推荐(0)
摘要: 问题 C++编译报错cannot bind non-const lvalue reference of type ... 后续检查发现是出参发生了隐式地址转换,而入参数为常引用不受影响。 复现 代码举例说明 #include <iostream> #include <unsupported/Eige 阅读全文
posted @ 2022-05-03 21:22 azureology 阅读(1626) 评论(0) 推荐(0)
摘要: 需求 使用某些应用需要走特定代理,指定HTTP_PROXY无效又不想设置系统代理。 实现 使用proxychains实现对某个程序的单独代理,用法类似sudo加在命令前缀即可。 手动配置代理地址位于/etc/proxychains.conf底部,支持socks, https, http。 注意使用G 阅读全文
posted @ 2022-05-02 10:03 azureology 阅读(243) 评论(0) 推荐(0)
摘要: 问题 使用Eigen::Tesnor进行运算,需要类似Python的切片赋值操作。 实现 可以使用slice和chip两个方法实现切片 slice 用法 slice(const StartIndices& offsets, const Sizes& extents) 切片后维度不变,从offsets 阅读全文
posted @ 2022-05-01 21:11 azureology 阅读(3930) 评论(0) 推荐(0)
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 76 下一页