本文介绍了stl引用C ++ 11的容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题被问了一百万遍。大多数答案只是说该对象应该是CopyAssignable和CopyConstructible。但是明确指出,这是规则(直到C ++ 11 )!但是,它仍然行不通。为什么?

I know this question was asked a million of times. And most of answers just says that object should be CopyAssignable and CopyConstructible. But documentation clearly says this is the rule (until C++11)! But still it doesn't work. Why?

推荐答案

是的,现在的要求不再那么严格了。但是,在您要引用的部分的正下方,链接的文档明确指出

Yes, the requirements are less strict now. However, right below the part you're referencing, the linked documentation clearly states that:

引用不符合Erasable的要求,因此它们仍然无法工作。

References don't meet the requirements of Erasable, therefore they still can't work.

这篇关于stl引用C ++ 11的容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 06:39