上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 36 下一页
摘要: 更新项目版本号时,需要与 rc 文件的 version 同步,比较方便的方法是直接从 rc 文件中获取版本号,并应用到程序中 // 删除日志检查 bool GetVersion() { // get the filename of the executable containing the vers 阅读全文
posted @ 2022-07-07 11:16 strive-sun 阅读(483) 评论(0) 推荐(0) 编辑
摘要: {} 可以用于初始化 C++11 中的变量,就像它们用于初始化 C 中的数组和结构一样。 {} 主要是为了提供语法的一致性(使用 {} 初始化将在所有上下文中都有效,而使用赋值运算符或()初始化将在特定上下文中有效) {} 初始化还有一个优点,它可以防止缩小范围,即当需要 double 型时,它可以 阅读全文
posted @ 2022-07-06 18:57 strive-sun 阅读(1111) 评论(0) 推荐(0) 编辑
摘要: 项目搭建时,发现在使用高版本 sentry-cli 上传 pdb 文件后会报 404 错误,同事猜测高版本的 sentry-cli 会返回错误的地址,建议我用低版本的试一下 依据教程,我在 windows 上安装 1.72.2 的 sentry-cli curl -sL https://sentry 阅读全文
posted @ 2022-06-28 15:54 strive-sun 阅读(942) 评论(0) 推荐(0) 编辑
摘要: 官方的解释 “Cronet is the networking stack of Chromium put into a library for use on mobile. This is the same networking stack that is used in the Chrome b 阅读全文
posted @ 2022-06-24 15:31 strive-sun 阅读(1857) 评论(0) 推荐(0) 编辑
摘要: 今天在编译项目时,代码审查提示 “Single-parameter constructors should be marked explicit” 于是就在构造函数前加上 explicit 下面为最小的示例,这个示例主要是按文件创建时间排序并删除过期的文件 #include <iostream> # 阅读全文
posted @ 2022-06-22 18:15 strive-sun 阅读(351) 评论(0) 推荐(0) 编辑
摘要: 常用的 windbg 命令 .ecxr 用来切换到异常发生时的上下文,主要用在分析静态 dump 文件的时候。当我们使用 .reload 命令去强制加载库的 pdb 文件后,需要执行 .ecxr 命令,重新切换到异常上下文 kn/kv/kp 用来查看当前线程的函数调用堆栈。如果要查看当前进程的所有线 阅读全文
posted @ 2022-06-15 11:19 strive-sun 阅读(868) 评论(0) 推荐(0) 编辑
摘要: 尽量不使用无锁架构,除非绝对必要 复杂性中有一些东西吸引了每一位工程师。与常规同步机制(如互斥锁、条件变量、异步等)相比,无锁编程听起来非常性感。然而,与我交谈过的每一位经验丰富的 C++ 开发人员都认为,使用无锁编程作为首要手段是一种过早的优化形式,可能会在最合适的时候再次困扰你(想想当你没有完整 阅读全文
posted @ 2022-05-31 01:57 strive-sun 阅读(54) 评论(2) 推荐(0) 编辑
摘要: 在 C++11 中,不要将 volatile 用于线程,仅限于 MMIO(内存映射) 简单的回答, 在声明变量类型之前添加 "volatile" 关键字不会使对该变量有任何方式的原子操作或者线程安全,我们需要使用 std::atomic 详细的解释, 参考:When to use volatile 阅读全文
posted @ 2022-05-31 01:51 strive-sun 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 在 async 任务中抛出的异常会被 std::future::get() 触发 #include <future> #include <iostream> int main() { std::future<int> myFuture = std::async(std::launch::async, 阅读全文
posted @ 2022-05-31 01:43 strive-sun 阅读(64) 评论(0) 推荐(0) 编辑
摘要: std::async 在简单的 IO 上比 std::thread 更有优势 前提:如果我们只需要一些异步执行的代码,这样不会阻塞主线程的执行,最好的办法是使用 std::async 来执行这些代码。这些操作我们也可以使用 std::thread 创建线程并通过函数指针 或者 lambda 参数将可 阅读全文
posted @ 2022-05-28 16:04 strive-sun 阅读(137) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 36 下一页