]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/views/reversible_view.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / geometry / views / reversible_view.hpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
6
7 // This file was modified by Oracle on 2020.
8 // Modifications copyright (c) 2020 Oracle and/or its affiliates.
9 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
10
11 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
12 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
13
14 // Use, modification and distribution is subject to the Boost Software License,
15 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
16 // http://www.boost.org/LICENSE_1_0.txt)
17
18 #ifndef BOOST_GEOMETRY_VIEWS_REVERSIBLE_VIEW_HPP
19 #define BOOST_GEOMETRY_VIEWS_REVERSIBLE_VIEW_HPP
20
21
22 #include <boost/version.hpp>
23 #include <boost/range/adaptor/reversed.hpp>
24
25 #include <boost/geometry/core/ring_type.hpp>
26 #include <boost/geometry/core/tag.hpp>
27 #include <boost/geometry/core/tags.hpp>
28
29 #include <boost/geometry/views/identity_view.hpp>
30
31 namespace boost { namespace geometry
32 {
33
34 /*!
35 \brief Flag for iterating a reversible_view in forward or reverse direction
36 \ingroup views
37 */
38 enum iterate_direction { iterate_forward, iterate_reverse };
39
40 /*!
41 \brief View on a range, reversing direction if necessary
42 \tparam Range original range
43 \tparam Direction direction of iteration
44 \ingroup views
45 */
46 template <typename Range, iterate_direction Direction>
47 struct reversible_view {};
48
49
50
51 #ifndef DOXYGEN_NO_SPECIALIZATIONS
52
53 template <typename Range>
54 struct reversible_view<Range, iterate_forward>
55 {
56 typedef identity_view<Range> type;
57 };
58
59
60 template <typename Range>
61 struct reversible_view<Range, iterate_reverse>
62 {
63 #if BOOST_VERSION > 104500
64 typedef boost::reversed_range<Range> type;
65 #else
66 // For older versions of Boost
67 typedef boost::range_detail::reverse_range<Range> type;
68 #endif
69 };
70
71 #endif // DOXYGEN_NO_SPECIALIZATIONS
72
73
74 }} // namespace boost::geometry
75
76
77 #endif // BOOST_GEOMETRY_VIEWS_REVERSIBLE_VIEW_HPP