测试set返回值
int main(int argc, char* argv[])
{
printf("Starting ...\n");
std::set intset;
for(int i = 0; i < 10; i++)
intset.insert(i);
std::set::iterator it;
for(it = intset.begin(); it != intset.end(); it++)
printf("%d\n", (*it));
pair::iterator,bool> ret;
for(int i = 12; i < 15; i++)
{
ret = intset.insert(i);
printf("ret =%d\n",ret.second);
}
printf("Ending ...\n");
return 0;
}
阅读(759) | 评论(0) | 转发(0) |