
C++11
文章平均质量分 53
ken_scott
这个作者很懒,什么都没留下…
展开
-
C++11学习:auto和decltype
#include /* C++03 style */ template R add(T1 t1, T2 t2) { std::cout << "C++03 style" << std::endl; return(t1 + t2); } /* C++11 style */ /* way 1 */ template auto add(T1 t1,原创 2013-07-29 21:53:51 · 1192 阅读 · 0 评论 -
一个有趣的测试【std::bind、std::move、boost::asio::post()】
经常忘记,留个代码给自己快速理解回忆#include <ctime> #include <cstdlib> #include <iostream> #include <boost/asio.hpp> struct times_t // for test copy-construct and move-construct { times_t(...原创 2018-03-31 21:22:33 · 1221 阅读 · 0 评论 -
【笔记】函数类型,函数指针,函数引用的typedef和using的声明
测试笔记 #include <iostream> typedef int func_t_t(int, int); typedef int(*func_t_p)(int, int); typedef int(&func_t_r)(int, int); using func_u_t = int(int, int); using func_u_p = int(*)(int,...原创 2018-08-27 10:37:50 · 2879 阅读 · 1 评论