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

在书中13.5章时的一个小疑问 #80

Open
KinoluKaslana opened this issue Mar 10, 2018 · 4 comments
Open

在书中13.5章时的一个小疑问 #80

KinoluKaslana opened this issue Mar 10, 2018 · 4 comments

Comments

@KinoluKaslana
Copy link

书中定义的类中为什么alloc是static的?如果是后面的拷贝和赋值是不是都有问题(不是所有对象公用这个元素的吗)

@pezy
Copy link
Member

pezy commented Mar 12, 2018

书中定义的类中为什么alloc是static的?

中文版的吧?貌似英文版并无这个 static.

这个问题貌似以前讨论过: #58

@KinoluKaslana
Copy link
Author

查看了下,中文版的大大小小还有一些问题,特别是后面的有个练习题,前后置都译反了

@MESS8
Copy link

MESS8 commented Aug 13, 2019

轮子哥的锅

@kingOni
Copy link

kingOni commented Sep 19, 2020

static你写的时候是在.h文件中声明的,你要用的话就得在.cpp文件中定义它。不然就会报错
allocator StrVec::alloc;
把这行加入.cpp文件就行了

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

4 participants