
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@yahoo.com 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@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users