set容器判断是否插入成功

 set<int> sa;
    bool flag = sa.insert(1).second;
    bool flag2 = sa.insert(1).second;
    cout<<"flag="<<flag<<endl;
    cout<<"flag2="<<flag2<<endl;
posted @ 2022-07-25 15:55  萧海~  阅读(36)  评论(0编辑  收藏  举报