Cpp_Primer_Answers
Cpp_Primer_Answers copied to clipboard
练习12.33 get_file编写有误
file本身就是一个智能指针了,直接return即可。 答案中用make_shared,但是编写有误,不能用file初始化此对象,要用也是用*file。
shared_ptr<vector<string>> get_file() const { return make_shared<vector<string>>(*file); }