STL 积累

来源:互联网 发布:白葡萄酒 品牌 知乎 编辑:程序博客网 时间:2024/06/05 23:49

#include <list>
#include <algorithm>
using namespace std;

////////////////////////////

list<U*> m_List;

list<U*>::iterator it = m_List.begin(),itend = m_List.end();
    if(std::find(it,itend,p) == itend){
      m_List.push_back(p);
    }else{
      cout<<"不好意思,加重复了"<<endl;
    }

//////////////////////////////////////

list<U*>::iterator it = m_List.begin(),itend = m_List.end();
    for(; it != itend; it++){
      *it->Update(t);
    }

////////////////////////////////////////

原创粉丝点击