| Home | Libraries | People | FAQ | More

##### Boost.Range reversed

Boost.Range reversed range adaptor is adapted to Boost.Geometry

###### Description

Boost.Range reversed range adaptor reverses a range.

###### Model of

The Boost.Range reversed range adaptor takes over the model of the original geometry, which might be:

- a linestring
- a ring
- a multi_point
- a multi_linestring
- a multi_polygon

###### Header

`#include <boost/geometry/geometries/adapted/boost_range/reversed.hpp>`

The standard header `boost/geometry.hpp` does not include this header.

###### Example

Shows how to use a Boost.Geometry linestring, reversed by Boost.Range adaptor

    #include <iostream>

    #include <boost/geometry.hpp>
    #include <boost/geometry/geometries/linestring.hpp>
    #include <boost/geometry/geometries/point_xy.hpp>
    #include <boost/geometry/geometries/adapted/boost_range/reversed.hpp>

    int main()
    {
        using xy = boost::geometry::model::d2::point_xy<int>;
        boost::geometry::model::linestring<xy> line;
        line.push_back(xy(0, 0));
        line.push_back(xy(1, 1));

        std::cout
            << boost::geometry::dsv(line | boost::adaptors::reversed)
            << std::endl;

        return 0;
    }

Output:

    ((1, 1), (0, 0))