Boost logo

Boost Users :

Subject: Re: [Boost-users] [Range] simple (I hope) question
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-07-10 11:06:14


AMDG

Kenny Riddile wrote:
> Say I have a vector of vectors and I want to sort each "child" vector.
> How would I accomplish this using range::for_each and range::sort?

#include <vector>
#include <boost/range/algorithm/for_each.hpp>
#include <boost/spirit/home/phoenix/stl/algorithm/transformation.hpp>
#include <boost/spirit/home/phoenix/core.hpp>

int main() {
    std::vector<std::vector<int> > vec;
    boost::range::for_each(vec,
boost::phoenix::sort(boost::phoenix::arg_names::_1));
}

In Christ,
Steven Watanabe


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