在 C++ 11 中实现 apply

Why apply matters

假设我们要实现一个和具体业务无关的 HTTP(S) 网络 (Restful)API 请求设施 RequestConnection,我们至少要提供两个实现:

Read More

Monthly Read Posts in Feb 2017

RESTful架构风格下的4大常见安全问题

  • Don’t forget to check correlations between resources in request URL

Read More

Monthly Read Posts in Jan 2017

Library order in static linking

An object file both provides (exports) external symbols to other objects and libraries, and expects (imports) symbols from other objects and libraries.

Read More

编译期判断是否存在某个成员函数

之前在某篇文章描述了一个实际上不是那么好用的检查某个模板类型参数是否存在某个函数的方法。

这次会介绍一个相对有用的,在编译期检查某个类是否存在给定成员函数的做法,并且可以根据检查的结果执行不同的代码。

Read More

自动开始安装 Inno Setup 打包的安装程序

有时候我们希望用户执行安装程序后,跳过路径选择等一系列确认,自动开始安装,已尽可能减少等待时间。

最明显的例子就是,用户在已经安装程序的情况下,下载了新版的安装包,需要执行更新操作。因为安装路径、设置选项等信息早在用户首次安装时就已经确定,升级安装过程中完全可以跳过。

某科学的直播姬在加入自动更新功能的同时,就需要安装包具备上述能力。

Read More

自动将 non-capturing lambda 转换为函数指针

在开发某科学的直播姬的过程中,经常需要在 obs-studio 处理源之后紧接着做一些事情,例如针对大图片源做自动放缩等。

obs-studio 采用一个专有的 graphics rendering thread 来渲染各种 visualizable sources,并且允许你根据需求,注册各种底层源操作事件的回调函数(obs-studio 自己称之为 signal handler)。

Read More

Monthly Read Posts in Dec 2016

C++ Performance: Common Wisdoms and Common “Wisdoms”

The post discusses some oftenly-argued performance related aspects of C++.

Read More