CMake Cookbook Notes 5: Configure-time and Build-time Operations
Chapter 5 Configure-time and Build-time OperationsThere are three important periods during the whole process of building with CMake:
configure time: ...
CMake Cookbook Notes 4: Creating and Running Tests
Chapter 4 Creating and Running Tests4.1 Creating a simple unit test
Use enable_testing and add_test to create tests with built-in CMake functionalit ...
CMake Cookbook Notes 3: Detecting External Libraries and Programs
Chapter 3 Detecting External Libraries and Programs3.1 Detecting the Python interpreter
find_package can be used to find a package located somewhere ...
CMake Cookbook Notes 2: Detecting the Environment
Chapter 2 Detecting the Environment2.1 Discovering the operating system
We can get info about the OS from variable CMAKE_SYSTEM_NAME :
cmake1if(CMAK ...
CMake Cookbook Notes 1: From a Simple Executable to Libraries
Chapter 1 From a Simple Executable to Libraries1.1 Compiling a single source file into an executable
The CMake language (e.g. the function name) is ...
叶子
上海作为一座城市,我们也有一周没见了。吃完早饭看了几眼地图,便欣然赴约。天气比上周好些,虽说有些炎热,但是走在去往地铁口的路上心情还算愉悦,云山路没有预料的那么陌生。
相见时一开始的气氛总是不那么活跃的。我戴着耳机,听着你提过的好地方,我标在地图上,或者如今一个人听歌总是会觉得失落。什么时候气氛开始 ...
遇见上海
午后出发,一部冰冷的电梯,从十五楼下去。推开门,淅沥小雨,着实有些扫兴。不过转念一想,也罢,小雨中清醒总比阳光下昏沉要好一些。
沿着已经熟悉现在却又陌生起来的路走到地铁口,在世纪大道不自觉地就上了开往浦电路的 4 号线,坐在地铁上意识到自己坐反了,到了浦电路准备下车坐朝另一方向开去的地铁,瞟了眼地图 ...
C++ 中表达式的 Value Categories
表达式有类型(type),也有值类别(value category)。
Before C++11在 C++11 之前,值类别只有 lvalue(左值)和 rvalue(右值)两种。考虑这样一个场景:
c++12int b = 3;int a = b;
第一条语句中,3 是表达式,类型为 int, ...
Effective Modern C++ 笔记(8):Tweaks
Chapter 8 TweaksItem 41 Consider pass by value for copyable parameters that are cheap to move and always copied
当需要根据参数为左值还是右值做不同的处理时,可以使用重载或者完美转发,但 ...
Effective Modern C++ 笔记(7):The Concurrency API
Chapter 7 The Concurrency APIItem 35 Prefer task-based programming to thread-based
异步执行一个函数有两种方法:std::thread 和 std::async:
c++12345int doAsyncWork() ...