Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5027: Extension of Boost.Range algorithms
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-03-26 11:40:41
#5027: Extension of Boost.Range algorithms
--------------------------------------------+-------------------------------
Reporter: gast128 <gast128@â¦> | Owner: marshall
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: range
Version: Boost 1.45.0 | Severity: Not Applicable
Resolution: | Keywords:
--------------------------------------------+-------------------------------
Comment (by gast128):
void Test()
{
std::vector<Person> vecPersons;
std::vector<Person> vecPersons2;
std::copy_if(vecPersons.cbegin(), vecPersons.cend(),
std::back_inserter(vecPersons2), [](const Person& crPerson) -> bool
{
return crPerson.GetAge() == 27;
});
auto fc = [](const Person& crPerson) -> bool
{
return crPerson.GetAge() == 27;
};
boost::copy(vecPersons| boost::adaptors::filtered(fc),
std::back_inserter(vecPersons2));
}
note: somehow my formatting gets lost, forgot how to fix that.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5027#comment:5> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC