{"action":"created","issue":{"url":"https://api.github.com/repos/ReadingLab/Discussion-for-Cpp/issues/58","repository_url":"https://api.github.com/repos/ReadingLab/Discussion-for-Cpp","labels_url":"https://api.github.com/repos/ReadingLab/Discussion-for-Cpp/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/ReadingLab/Discussion-for-Cpp/issues/58/comments","events_url":"https://api.github.com/repos/ReadingLab/Discussion-for-Cpp/issues/58/events","html_url":"https://github.com/ReadingLab/Discussion-for-Cpp/issues/58","id":142339438,"number":58,"title":"StrVec和Vec的实现","user":{"login":"Nwpuer","id":12567703,"avatar_url":"https://avatars.githubusercontent.com/u/12567703?v=3","gravatar_id":"","url":"https://api.github.com/users/Nwpuer","html_url":"https://github.com/Nwpuer","followers_url":"https://api.github.com/users/Nwpuer/followers","following_url":"https://api.github.com/users/Nwpuer/following{/other_user}","gists_url":"https://api.github.com/users/Nwpuer/gists{/gist_id}","starred_url":"https://api.github.com/users/Nwpuer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nwpuer/subscriptions","organizations_url":"https://api.github.com/users/Nwpuer/orgs","repos_url":"https://api.github.com/users/Nwpuer/repos","events_url":"https://api.github.com/users/Nwpuer/events{/privacy}","received_events_url":"https://api.github.com/users/Nwpuer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-21T12:59:48Z","updated_at":"2016-03-22T00:54:29Z","closed_at":null,"body":"ex13.39（实现StrVec）中的alloc为什么不像书上那样声明为static成员呢？\r\n我在实现ex16.16（将StrVec实现为模板）时，发现将alloc声明为非static成员会编译通过，而如果将它声明为static的话，VS2013会提示“无法解析的外部符号”，能不能解释一下为什么？"},"comment":{"url":"https://api.github.com/repos/ReadingLab/Discussion-for-Cpp/issues/comments/199566145","html_url":"https://github.com/ReadingLab/Discussion-for-Cpp/issues/58#issuecomment-199566145","issue_url":"https://api.github.com/repos/ReadingLab/Discussion-for-Cpp/issues/58","id":199566145,"user":{"login":"pezy","id":1147451,"avatar_url":"https://avatars.githubusercontent.com/u/1147451?v=3","gravatar_id":"","url":"https://api.github.com/users/pezy","html_url":"https://github.com/pezy","followers_url":"https://api.github.com/users/pezy/followers","following_url":"https://api.github.com/users/pezy/following{/other_user}","gists_url":"https://api.github.com/users/pezy/gists{/gist_id}","starred_url":"https://api.github.com/users/pezy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pezy/subscriptions","organizations_url":"https://api.github.com/users/pezy/orgs","repos_url":"https://api.github.com/users/pezy/repos","events_url":"https://api.github.com/users/pezy/events{/privacy}","received_events_url":"https://api.github.com/users/pezy/received_events","type":"User","site_admin":false},"created_at":"2016-03-22T00:54:29Z","updated_at":"2016-03-22T00:54:29Z","body":"> ex13.39（实现StrVec）中的alloc为什么不像书上那样声明为static成员呢？\r\n\r\n13.5 章节里 `StrVec` 类的定义中，没把 `alloc` 声明为 static 啊。你指的是哪里的定义？\r\n\r\n另外，为什么要声明为 static 呢？\r\n\r\n> 我在实现ex16.16（将StrVec实现为模板）时，发现将alloc声明为非static成员会编译通过，而如果将它声明为static的话，VS2013会提示“无法解析的外部符号”，能不能解释一下为什么？\r\n\r\n方便贴出代码吗？"}}