2017年1月17日
摘要: free -m total used free shared buffers cached Mem: 16050 15890 160 0 1355 13774 (system 角色) -/+ buffers/cache: 759 15291 (application 角色) Swap: 8191 0 阅读全文
posted @ 2017-01-17 15:52 abelian 阅读(124) 评论(0) 推荐(0) 编辑
摘要: https://www.zhihu.com/question/51253466 #include <iostream> #include <fstream> #include <memory> #include <iterator> #include <type_traits> #include < 阅读全文
posted @ 2017-01-17 09:52 abelian 阅读(220) 评论(0) 推荐(0) 编辑
  2017年1月16日
摘要: #include <iostream> using namespace std; template<typename T> class A { }; template<typename T> class B { }; template<typename T, template<typename > 阅读全文
posted @ 2017-01-16 19:26 abelian 阅读(140) 评论(0) 推荐(0) 编辑
  2017年1月15日
摘要: https://www.zhihu.com/question/54713079/answer/140746689 #include <iostream> using namespace std; template<class T> struct foo { using type = T; }; te 阅读全文
posted @ 2017-01-15 11:14 abelian 阅读(172) 评论(0) 推荐(0) 编辑
  2017年1月11日
摘要: http://stackoverflow.com/questions/38611823/variadic-variadic-template-template-parameters-parameters variadic variadic template template parameters i 阅读全文
posted @ 2017-01-11 14:26 abelian 阅读(118) 评论(0) 推荐(0) 编辑
  2017年1月9日
摘要: lexical_cast 提供string2int, int2string, #define(...) 可变宏:…和__VA_ARGS__ 宏定义中参数列表的最后一个参数为省略号(三个英文句号,省略号只能代替最后参数)。这样,预定义宏__VA_ARGS__就可以被用在替换部分中,以表明省略号代码什么 阅读全文
posted @ 2017-01-09 12:41 abelian 阅读(164) 评论(0) 推荐(0) 编辑
  2017年1月8日
摘要: template<typename T,typename P> struct type_para { typedef T type; P p; ..... }; template<typename T,typename ...AK> auto create(AK&&... ak) { return 阅读全文
posted @ 2017-01-08 09:33 abelian 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 一,判断在类中某个函数(也可以是变量或类型)是否存在 template<typename T> struct xxxx_detector { template<typename P,void (P::*)(void)> struct detector{}; template<typename P> 阅读全文
posted @ 2017-01-08 09:31 abelian 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 一,判断在类中某个函数(也可以是变量或类型)是否存在 template<typename T> struct xxxx_detector { template<typename P,void (P::*)(void)> struct detector{}; template<typename P> 阅读全文
posted @ 2017-01-08 09:22 abelian 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 首先我们的第一步当然是将tuple解包。tuple提供了一个get函数来获取第N个元素。例如: get<1>(make_tuple(...)); 要将一个tuple全部拆解,就可以使用通过多次调用这个函数来进行解析,例如: auto tup = make_tuple(..........); fun 阅读全文
posted @ 2017-01-08 09:06 abelian 阅读(332) 评论(0) 推荐(0) 编辑