0
点赞
收藏
分享

微信扫一扫

C++ std::multiset返回值 has no member named ‘first’

juneyale 2022-01-31 阅读 55


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;
}

C++ std::multiset返回值 has no member named ‘first’_#include

​​multiset::emplace - 游戏蛮牛 - C++中文翻译用户手册​​


举报

相关推荐

0 条评论