set<int> s1;
auto ret = s1.insert(10);
if (ret.second)
cout << "插入成功" << endl;
else
cout << "插入失败" << endl;
auto ret2 = s1.insert(10);
if (ret2.second)
cout << "插入成功" << endl;
else
cout << "插入失败" << endl;
原文:https://www.cnblogs.com/lodger47/p/14714190.html