Skip to content

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

Description

@z974890869

在书中 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>>类型值初始化为什么不带有类型呢

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions