Boost logo

Boost Users :

From: yinglcs2_at_[hidden]
Date: 2006-02-24 01:30:32


Hi,

I have the code which copy from a STL list to another
if a condition is met:

list<A*> alist;

        for (list<A*>::iterator iter = alist.begin(); iter !=
alist.end(); ++iter) {

                  A* a = (*iter);

                  if ( a->aFunc( i, j) {
               destList.push_back(a);
                        }
                }

I try doing this, but it does not compile:

for_each(alist.begin(), alist.end(),
        if_then( bind(&A::aFunc, _1 , i, j ),
columnBlocks.push_back(_1)));

There are my errors:

 error: no matching function for call to
‘std::vector<A*, std::allocator<A*>
>::push_back(const
boost::lambda::lambda_functor<boost::lambda::placeholder<1>
>&)
error: ‘if_then’ was not declared in this scope

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


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