05 2022 档案
摘要:https://blog.csdn.net/qq_52433890/article/details/121502538
阅读全文
摘要:右值引用与移动语义使得容器的效率有了大幅提升。 如果传入的为临时变量,自动识别为右值。(下面的类A中没有指针成员变量,没有体现移动构造函数的好处,只是为了演示过程) #include <iostream> #include <vector> using namespace std; class A{
阅读全文
摘要:default_random_engine e(time(nullptr)); uniform_int_distribution<unsigned> u(0,9); for (int i = 0;i<10; i++) { cout << u(e) << " "; }
阅读全文
摘要:#include <iostream> using namespace std; void print() {} template<typename Type, typename... Types> void print(Type firstArg, Types ...args) { cout <<
阅读全文