Boost logo

Boost Users :

From: Tino S. (schumi_75_at_[hidden])
Date: 2005-07-27 03:19:17


Hi Thaddeus,

this code works for me...

Greetings Tino

int main()
{
 std::string in;
 std::vector<A *> alist;
 std::vector<A *> longAList;
 typedef std::vector<A *> myType;

 // std::back_insert_iterator< myType >
inserter(longAList);

 while(in!="end")
 {
   in="";
   std::getline(std::cin,in);
   alist.push_back(new A(in));
 }
 std::for_each(alist.begin(),alist.end(),
        //*inserter++ = &(*_1)
        boost::lambda::if_then( bind(&A::isLong,_1),
bind(&myType::push_back ,&longAList, _1) ));

 return 1;
}

        

        
                
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net