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

Construct.h中析构元素中有个小疑问? #22

Open
L-admin opened this issue Feb 24, 2017 · 1 comment
Open

Construct.h中析构元素中有个小疑问? #22

L-admin opened this issue Feb 24, 2017 · 1 comment

Comments

@L-admin
Copy link

L-admin commented Feb 24, 2017

template<class ForwardIterator>
	inline void destroy(ForwardIterator first, ForwardIterator last){
		typedef typename _type_traits<ForwardIterator>::is_POD_type is_POD_type;
		_destroy(first, last, is_POD_type());

我的理解ForwardIterator 应该是表示迭代器? 那萃取的应该是*ForwardIterator,为什么是ForwardIterator?望赐教, Thx。

@zinx2016
Copy link

zinx2016 commented Jun 4, 2017

是的,我也发现这个问题了。应该先得到迭代器指向的值的类型,然后在调用上面那步。如果这样写,那这一版本的destroy()就不能发挥作用。

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

2 participants