#include <iostream>
#include <list>
using namespace std;
class notBigi
{
private:
int m_i;
list<int> ll;
public:
notBigi(int i):m_i(i){}
bool operator() (int j)
{
if ( j == m_i)
{
return true;
}
else
return false;
}
};
void main()
{
list <int> l;
l.clear();
for ( int i = 0; i < 10; i++)
{
l.push_back(i);
}
l.remove_if(notBigi(7));
list<int>::iterator i1,i2;
for (i1 = l.begin(); i1 != l.end(); i1++)
{
i2 = i1;
i2++;
cout << "i1 " << *i1 <<endl;
if (i2 == l.end())
{
cout << "i2 reach end"<<endl;
}
//cout << "i2 " << *i2 <<endl;
// if ( i1 < i2)
// {
// cout << "i1 < i2" <<endl;
// }
// else if (i1 > i2)
// cout << "i1 > i2" <<endl;
// else
// cout << "error " <<endl;
}
}
08-21