<分区>
Possible Duplicate:
Why does stack<const string> not compile in g++?
An answer to another question
解释了为什么我们(假设)不能拥有 const
对象的容器。例如,这是不允许的:
vector<const int> v; //not allowed
但是为什么对
允许第一个对象是const
?这确实是 map
对象中的 pair
发生的情况。我错过了什么吗?
非常感谢对这种现象的详细和直观的解释。