value_type, key_type, mapped_type, reference,const_reference
2014-09-25 21:02
176 查看
int main() { map<string, char> testMap; testMap["A"] = 1; map<string, char>::mapped_type mapVal = testMap["A"]; vector<int> testVector; testVector.push_back(1); vector<int>::value_type vectorVal = testVector[0]; printf("%d\n", mapVal); printf("%d\n", vectorVal); }
输出1, 1
相关文章推荐
- invalid initialization of non-const reference of type ‘xxx&’ from an rvalue of type ‘xxx’
- C++ 10.3 关联容器map定义以及value_type、key_type、mapped_type
- C++引用报错:invalid initialization of non-const reference of type ‘std::string&’ from an rvalue of type
- C++之invalid initialization of non-const reference of type ‘int&’ from an rvalue of type ‘int’
- C++引用报错:invalid initialization of non-const reference of type ‘std::string&’ from an rvalue of type
- Value Type And Reference Type
- 条款20:宁以pass-by-reference-to-const替换pass-by-value
- 条款20:宁以pass-by-reference-to-const替换pass-by-value
- WRONGTYPE Operation against a key holding the wrong kind of value
- C# - test and cast with reference type or value...
- spark StructType的应用,用在处理mongoDB keyvalue
- invalid initialization of non-const reference of type ‘int*&’ from a temporary of type ‘int*’
- Effective C++--条款20:适当地用pass-by-reference-to-const代替pass-by-value
- 【Hadoop】Hadoop开发中wrong key/value与type mismatch错误
- 【20】宁以pass-by-reference-to-const替换pass-by-value
- 《Effective C++》条款20宁以pass-by-reference-to-const替换pass-by-value
- invalid initialization of non-const reference of type ‘int*&’ from a temporary of type ‘int*’
- Effective C++条款20:宁以pass-by-reference-to-const替换pass-by-value
- WRONGTYPE Operation against a key holding the wrong kind of value