Boost logo

Boost Users :

From: Perry Smith (pedz_at_[hidden])
Date: 2006-02-15 22:51:11


In Stroustrup's book "The C++ Programming Language -- 3rd edition",
18.6 is "Modifying Sequence Algorithms". 18.6.1 is "Copy". He talks
about what is in the standard and then gives an example almost what
you are asking for.

You could also use the standard Copy (described in 25.2.1 of the
standard) and compute the "InputInterator last" using your criterial
before doing the copy. Yes, that does make two passes but any test
inside the copy loop will cost almost the same.

On Feb 15, 2006, at 8:58 PM, yinglcs2_at_[hidden] wrote:

>
> How can I copy elements from one STL container to
> another STL container
> if a condition is met and if it find an element fails
> that condition,
> it stops the copying?
>
> I wonder if Boost has library for that. I don't think
> the original STL algorithm handle this case.
>
> Thank you.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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