
Cpp
文章平均质量分 61
oncealong
这个作者很懒,什么都没留下…
展开
-
Smart Pointer Programming Techniques
转自:https://www.boost.org/doc/libs/1_74_0/libs/smart_ptr/doc/html/smart_ptr.html#techniquesboost写的智能指针技术,陈硕也在书里推荐过,确实写得很不错,20个tips很快就可以看完Using incomplete classes for implementation hidingA proven technique (that works in C, too) for separating interf.翻译 2020-09-30 10:55:05 · 384 阅读 · 0 评论 -
(Xcode) 編譯器小白筆記 - LLVM前端Clang
转自:https://juejin.im/post/6844903716709990414做笔记之用(Xcode) 編譯器小白筆記 - LLVM前端Clang本文为笔记型式呈现,并非全部原创,来源见文末CompilerClang - LLVMApple(包括中后期的NeXT) 一直使用GCC作为官方的编译器。GCC作为开源世界的编译器标准一直做得不错,但Apple对编译工具会提出更高的要求。Clang这个软体专案在2005年由苹果电脑发起,是LLVM编译器...转载 2020-08-07 14:02:12 · 568 阅读 · 0 评论 -
Chromium 基础库使用说明
转自:https://www.zybuluo.com/rogeryi/note/56894Chromium 基础库使用说明chromiumbase作者: 易旭昕 (@roger2yi)Chromium 提供了一个类似 WTF 的基础库,甚至包含了更多的内容。这个基础库在 Blink 之外被广泛使用(Blink 里面仍然使用的是 WTF),了解它的使用对我们实际的代码编写是十分重要的。本文主要介绍 Chromium 基础库包括的主要内容,并详细说明一些重要类型的使用方式。如果需要了解某...转载 2020-07-10 17:05:27 · 1648 阅读 · 0 评论 -
C++的一个Tip:如何确定snprintf需要多大空间
const char *fmt = "sqrt(2) = %f";int sz = std::snprintf(nullptr, 0, fmt, std::sqrt(2));std::vector<char> buf(sz + 1); // note +1 for null terminatorstd::snprintf(&buf[0], buf.size(), fmt...原创 2019-11-28 16:33:09 · 681 阅读 · 0 评论 -
Clang vs Other Open Source Compilers
分享一篇文章, clang官方文章:https://clang.llvm.org/comparison.htmlClang vs Other Open Source CompilersBuilding an entirely new compiler front-end is a big task, and it isn't always clear to people why we de...原创 2018-12-28 10:02:34 · 300 阅读 · 0 评论 -
Android NDK编程: JNI技巧
前言: 这篇文章是android官方文档(https://developer.android.com/training/articles/perf-jni), 讲的非常赞. 有很多最佳实践, 比如储存classid/methodid, 管理线程, cpp和java线程交互, 异常UTF编码, 最后还有几个常见问题(UnsatisfiedLinkError错误, java和native分享数据)....翻译 2018-12-11 21:37:52 · 1796 阅读 · 0 评论 -
调试 Android ndk代码
调试 Android 平台原生代码https://source.android.google.cn/devices/tech/debugAndroid下使用AddressSanitizer检测内存错误https://source.android.com/devices/tech/debug/asan原创 2018-12-11 21:53:39 · 270 阅读 · 0 评论 -
C99/Cpp 使用printf 时format大全
使用printf时, 记住使用哪个字符格式化输出很麻烦, 常用的int/long还好记, 遇到int_32/size_t这种就麻爪了. 每次都要网上查下, C99标准的§7.19.6.1 (7)有定义, 但是每次翻pdf好麻烦, 而且显示的也不是那么易懂. 这里推荐cppreference, 使用图表格式, 十分易懂.Conversion specifier Explanati...原创 2018-12-23 17:08:02 · 2096 阅读 · 0 评论 -
C++并发编程(中文版)
地址:https://legacy.gitbook.com/book/chenxiaowei/cpp_concurrency_in_action/details 是《C++ Concurrency in Action》一书的中文翻译。基于C++11新标准的并发和多线程编程深度指南。 ...原创 2018-12-18 13:39:41 · 2747 阅读 · 0 评论 -
学习C++11/14
地址:https://www.bogotobogo.com/cplusplus/C11/英文资料. 关于右值引用和移动语义的两章不错.原创 2018-12-18 13:41:31 · 377 阅读 · 0 评论 -
The C++ 'const' Declaration: Why & How
The C++ 'const' Declaration: Why & How转自: http://duramecho.com/ComputerInformation/WhyHowCppConst.htmlThe 'const' system is one of the really messy features of C++.It is simple in concept: v...翻译 2018-11-29 17:44:05 · 270 阅读 · 0 评论 -
C++11多线程编程 第十章: 使用packaged_task优雅的让同步函数异步执行
C++11 Multithreading – Part 10: packaged_task<> Example and TutorialVarun July 2, 2017 C++11 Multithreading – Part 10: packaged_task Example and Tutorial2018-08-18T15:23:07+00:00C++ 11, c++11 ...翻译 2018-11-04 17:52:32 · 735 阅读 · 0 评论 -
C++11多线程编程 第一章: 创建线程的三种不同方式
C++11 Multithreading – Part 1 : Three Different ways to Create ThreadsVarun January 20, 2015 C++11 Multithreading – Part 1 : Three Different ways to Create Threads2018-08-18T15:04:02+00:00C++ 11, c+...转载 2018-11-04 15:43:19 · 1117 阅读 · 0 评论 -
C++11多线程编程 第二章: join 和 detach 线程
C++11 Multithreading – Part 2: Joining and Detaching ThreadsVarun January 21, 2015 C++11 Multithreading – Part 2: Joining and Detaching Threads2018-08-18T15:11:46+00:00C++ 11, c++11 Threads, std:...转载 2018-11-04 16:07:30 · 1228 阅读 · 0 评论 -
C++11多线程编程 第三章: 如何向线程传参
C++11 Multithreading – Part 3: Carefully Pass Arguments to ThreadsVarun January 22, 2015 C++11 Multithreading – Part 3: Carefully Pass Arguments to Threads2018-08-18T15:14:54+00:00C++ 11, c++11 Thre...转载 2018-11-04 16:19:22 · 518 阅读 · 0 评论 -
C++11多线程编程 第四章: 共享数据和竞态条件
C++11 Multithreading – Part 4: Data Sharing and Race ConditionsVarun February 21, 2015C++11 Multithreading – Part 4: Data Sharing and Race Conditions2018-08-18T15:17:01+00:00In multithreading envi...转载 2018-11-04 16:24:38 · 505 阅读 · 0 评论 -
C++11多线程编程 第五章: 使用锁来解决竟态条件
C++11 Multithreading – Part 5: Using mutex to fix Race ConditionsVarun February 22, 2015 C++11 Multithreading – Part 5: Using mutex to fix Race Conditions2018-08-18T15:19:37+00:002 CommentsIn this...翻译 2018-11-04 16:30:22 · 397 阅读 · 0 评论 -
C++11多线程编程 第六章: 多线程之间的事件处理
C++11 Multithreading – Part 6: Need of Event HandlingVarun June 1, 2015 C++11 Multithreading – Part 6: Need of Event Handling2018-08-18T15:20:06+00:00C++ 11, c++11 Threads, Multithreading 1 Comment...翻译 2018-11-04 16:37:58 · 1198 阅读 · 0 评论 -
C++11多线程编程 第七章: 条件变量及其使用方法
C++11 Multithreading – Part 7: Condition Variables ExplainedVarun June 2, 2015 C++11 Multithreading – Part 7: Condition Variables Explained2018-08-18T15:21:29+00:00C++, C++ 11, c++11 Threads, Multit...翻译 2018-11-04 16:49:36 · 518 阅读 · 0 评论 -
C++11多线程编程 第八章: 使用 std::future std::promise 更优雅的获取线程返回值
C++11 Multithreading – Part 8: std::future , std::promise and Returning values from ThreadVarun June 20, 2015 C++11 Multithreading – Part 8: std::future , std::promise and Returning values from Thre...翻译 2018-11-04 17:12:57 · 1211 阅读 · 0 评论 -
C++11多线程编程 第九章: std::async 更更优雅的写多线程
C++11 Multithreading – Part 9: std::async Tutorial & ExampleVarun May 5, 2017 C++11 Multithreading – Part 9: std::async Tutorial & Example2018-08-18T15:22:50+00:00C++, C++ 11, c++11 Threads,...翻译 2018-11-04 17:38:14 · 3619 阅读 · 1 评论 -
C++11多线程编程 绪论及总结
C++11多线程编程 这一系列文章是从 https://thispointer.com/c11-multithreading-tutorial-series/ 转过来的, 本来想翻译一下, 但看了些内容, 用词都不难, 读英文没有太大难度, 翻译过来反而怕用词不准画蛇添足, 所以干脆直接转过来了. 这一系列是程序猿学英语挺好的示例. 对一些章节有些感触或看法, 会在内容最后标出, 仅供参...原创 2018-11-06 11:07:53 · 517 阅读 · 0 评论