05 2021 档案
摘要:1.shared_ptr,智能指针构造函数是显式的,不能将一个内置指针隐式转换为一个智能指针,必须直接初始化。 shared_ptr<int> p1(new int(42)); shared_ptr<int> p2 = new int (42); //wrong 习题 12.2编写你自己的StrBl
阅读全文
摘要:习题 11.4编写你自己的单词计数程序,扩展你的程序,忽略大小写和标点。例如,"example."、"example,"和"Example"应该递增相同的计数器。 #include <string> #include <map> #include <iostream> #include <algor
阅读全文
摘要:只读 find(v.begin(), v.end(), 1); count(v.begin(), v.end(), 1); int sum = accumulate(v.begin(), v.end(), 0); //第三个值决定返回值的类型 string s1 = accumulate(v.beg
阅读全文

浙公网安备 33010602011771号