c++
一根优雅的腋毛
Only learning can make me happy!
展开
-
c++11 thread 类内使用方法和跨类使用方法
忘了为啥之前查的用上bind了,把项目搞完之后终于有时间建个小工程仔细试下怎么用。Case 1 : 根据类内函数创建threadclass A{public: A(); ~A(); void run(int i) { cout } void thread_run() { for (int i = 0; i thread t(&A::r原创 2017-12-22 16:58:33 · 8715 阅读 · 1 评论 -
基于C++可变模板参数的Log,任意个参数
class Log{public: Log(); ~Log(); template static void i(const T& t) { cout } template static void i(const T& t, Args ... args) { cout i(args...); }};int ma原创 2017-12-27 20:59:56 · 419 阅读 · 0 评论