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++中文翻译用户手册