摘要: 练习13.55 为你的StrBlob添加一个右值引用版本的Push_back void StrBlob::push_back(string&&s){data->push_back(std::move(s));} 练习13.56 如果sorted定义如下,会发生什么 Foo Foo::sorted() 阅读全文
posted @ 2022-08-16 21:10 yddl 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 练习13.49 为你的String类添加一个移动构造函数和一个移动赋值运算符 String(String&& a):elements(std::move(a.elements)),first_free(std::move(a.first_free)),cap(std::move(a.cap)){ a 阅读全文
posted @ 2022-08-16 16:42 yddl 阅读(59) 评论(0) 推荐(0) 编辑
摘要: 练习13.41 在push_back中我们为什么在construct调用后置递增 ::因为first_free指针就是第一个空闲位置,使用前置每次插入都会隔一个位置 练习13.42 在你的textQuery和Queryresult类中用strvec代替vector<string>进行测试 ::用St 阅读全文
posted @ 2022-08-16 14:20 yddl 阅读(55) 评论(0) 推荐(0) 编辑