摘要: Function Template 阅读全文
posted @ 2015-10-31 19:10 Jonas0608 阅读(153) 评论(0) 推荐(0) 编辑
摘要: the advantage of right value reference:Memory Optimizationsave memory copy 阅读全文
posted @ 2015-10-31 15:20 Jonas0608 阅读(364) 评论(0) 推荐(0) 编辑
摘要: advanced reference 阅读全文
posted @ 2015-10-30 21:57 Jonas0608 阅读(120) 评论(0) 推荐(0) 编辑
摘要: const and char*NOTICE: char *str = "hello"; the value of str is the address of the first letter (h)of string ; 阅读全文
posted @ 2015-10-29 21:09 Jonas0608 阅读(140) 评论(0) 推荐(0) 编辑
摘要: c Structc语言生命变量要加上structc语言结构体内部不能有函数C语言结构体没有共有,私有和继承 阅读全文
posted @ 2015-10-27 14:05 Jonas0608 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 1 //C++ 11 feature 2 template 3 auto getMultiply(T1 data1, T2 data2) -> decltype(data1*data2) 4 { 5 return data1*data2; 6 } 7 int main() 8 { 9 ... 阅读全文
posted @ 2015-10-27 13:22 Jonas0608 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Template Function _ Any number of parameters 1 #include 2 #include 3 using namespace std; 4 5 template 6 T getResult(int count,...) 7 { 8 va_lis... 阅读全文
posted @ 2015-10-27 11:36 Jonas0608 阅读(139) 评论(0) 推荐(0) 编辑
摘要: trap#define GET3(N) N*N*NGET3(1+2) : 1+2*1+2*1+2 = 7 阅读全文
posted @ 2015-10-25 18:54 Jonas0608 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Lvalue and Rvalue Referenceint a = 10;// a is in stackint& ra = a; // 左值引用int* && pa = &a; // 右值引用,指针类型的引用右值引用:用的是计算机CPU(寄存器)的值 或 内存的值。左值引用:必须是内存的值。 阅读全文
posted @ 2015-10-25 15:16 Jonas0608 阅读(211) 评论(0) 推荐(0) 编辑
摘要: How to prevent memory leaks ?overload new/delete 阅读全文
posted @ 2015-10-24 20:40 Jonas0608 阅读(128) 评论(0) 推荐(0) 编辑