本文主要是介绍C++ std::multiset返回值 has no member named ‘first’,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
error: ‘std::multiset<>::iterator {aka struct std::_Rb_tree_const_iterator<>}’ has no member named ‘first’
multiset返回的直接是迭代器,所以没有first
// INTEGER EXAMPLE
// CPP program to illustrate
// Implementation of emplace() function
#include <iostream>
#include <set>
using namespace std; int main()
{ multiset<int> mymultiset{}; auto result = mymultiset.emplace(3); cout << ' ' << (*result); // printing the multiset for (auto it = mymultiset.begin(); it != mymultiset.end(); ++it) cout << ' ' << *it; return 0;
}
multiset::emplace - 游戏蛮牛 - C++中文翻译用户手册
这篇关于C++ std::multiset返回值 has no member named ‘first’的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!