上一页 1 2 3 4 5 6 7 8 ··· 24 下一页
摘要: * std::list 是支持常数时间从容器任何位置插入和移除元素的容器。不支持快速随机访问。它通常实现为双向链表。与 std::forward_list 相比,此容器提供双向迭代但在空间上效率稍低。 阅读全文
posted @ 2019-12-15 15:14 路边的十元钱硬币 阅读(17111) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; // https://zh.cppreference.com/w/cpp/container/array int main() { ///array arr({ 1,2,3 }); // 非法 array arr1{ { 1,2,3 } }; // 不可以扩容,属于固定大小的数组。... 阅读全文
posted @ 2019-12-15 10:04 路边的十元钱硬币 阅读(8351) 评论(0) 推荐(1) 编辑
摘要: #include #include using namespace std; int main() { int ar[10] = { 1,2,3,4,5,6,7,8,9,0 }; std::vector vec5(ar, ar + 10); // reverse size_t cap1 = vec5.capacity(); // = 10 vec5.reserve(20)... 阅读全文
posted @ 2019-12-12 23:06 路边的十元钱硬币 阅读(1139) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <vector> #include <chrono> #include <windows.h> using namespace std; using namespace std::chrono; // 要考虑 copy ctor 和 copy 阅读全文
posted @ 2019-12-12 22:09 路边的十元钱硬币 阅读(392) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <vector> using namespace std; int main() { // 初始化的方式 std::vector<int> vec1; //std::vector<int> vec2(1750000);// 7G std::v 阅读全文
posted @ 2019-12-11 22:30 路边的十元钱硬币 阅读(5593) 评论(0) 推荐(0) 编辑
摘要: #include // operator Type() 类型操作符重载 // operator int() // operator double() // ... ////////////////////////////////////////////////////////// class Rectangle { public: #ifdef Want_compiler_to_add_... 阅读全文
posted @ 2019-12-02 19:33 路边的十元钱硬币 阅读(245) 评论(0) 推荐(0) 编辑
摘要: #include // operator Type() 类型操作符重载 // operator int() // operator double() // ... ////////////////////////////////////////////////////////// class Rectangle { public: Rectangle(const int w, cons... 阅读全文
posted @ 2019-12-02 19:22 路边的十元钱硬币 阅读(749) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> // 可变模板参数 // 此例:可以构造可变数量,可变类型的函数输入。 // 摘自:https://www.cnblogs.com/qicosmos/p/4325949.html ///////////////////////////// using namespace std; //递归终止函数 void print() { cout << "empty" 阅读全文
posted @ 2019-12-01 21:21 路边的十元钱硬币 阅读(578) 评论(0) 推荐(0) 编辑
摘要: #include // 可变模板参数 // 此例:可以构造可变数量,可变类型的函数输入。 // 摘自:https://www.cnblogs.com/qicosmos/p/4325949.html ///////////////////////////// using namespace std; //递归终止函数 void print() { cout void print(T h... 阅读全文
posted @ 2019-12-01 21:16 路边的十元钱硬币 阅读(843) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> // overloading "operator >> " outside class // >> 应该定义在类之外。 ////////////////////////////////////////////////////////// class Rectangle { public: Rectangle(int w, int h) : width(w), 阅读全文
posted @ 2019-12-01 16:27 路边的十元钱硬币 阅读(291) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 24 下一页