STL程序员开发指南源码
源代码在线查看: chapter9-3.cpp
//文件名:CHAPTER9-3.cpp
#include
#include
#if _MSC_VER > 1020 // if VC++ version is > 4.2
using namespace std; // std c++ libs implemented in std
#endif
int main( )
{
set s1;
set ::iterator s1_Iter;
set ::const_iterator s1_cIter;
s1.insert( 1 );
s1.insert( 2 );
s1.insert( 3 );
s1_Iter = s1.begin( );
cout s1_Iter = s1.begin( );
s1.erase( s1_Iter );
// The following 2 lines would err because the iterator is const
// s1_cIter = s1.begin( );
// s1.erase( s1_cIter );
s1_cIter = s1.begin( );
cout }