Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shared_ptr<set<size_type>> 值初始化为什么是空指针 #92

Open
z974890869 opened this issue Sep 4, 2020 · 0 comments
Open

shared_ptr<set<size_type>> 值初始化为什么是空指针 #92

z974890869 opened this issue Sep 4, 2020 · 0 comments

Comments

@z974890869
Copy link

在书中 TextQuery构造函数(建立单词与行号)中
auto &lines = wm[word]; //shared_ptr<set<size_typr>> wm if(!lines) line.reset(new set<size_type>);
我知道shared_ptr默认初始化是空指针
为什么:当word不在map中则对word关联的值进行值初始化,则lines将是空指针

word关联的值是 shared_ptr<set<size_typr>>类型值初始化为什么不带有类型呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant