]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/iterators/detail/iterator_base.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / geometry / iterators / detail / iterator_base.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-2021.
8 // Modifications copyright (c) 2020-2021 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_ITERATORS_DETAIL_ITERATOR_BASE_HPP
19 #define BOOST_GEOMETRY_ITERATORS_DETAIL_ITERATOR_BASE_HPP
20
21 #include <type_traits>
22
23 #include <boost/iterator/iterator_adaptor.hpp>
24 #include <boost/iterator/iterator_categories.hpp>
25
26 #ifndef DOXYGEN_NO_DETAIL
27 namespace boost { namespace geometry { namespace detail { namespace iterators
28 {
29
30 template
31 <
32 typename DerivedClass,
33 typename Iterator,
34 typename TraversalFlag = boost::bidirectional_traversal_tag
35 >
36 struct iterator_base
37 : public boost::iterator_adaptor
38 <
39 DerivedClass,
40 Iterator,
41 boost::use_default,
42 std::conditional_t
43 <
44 std::is_convertible
45 <
46 typename boost::iterator_traversal<Iterator>::type,
47 boost::random_access_traversal_tag
48 >::value,
49 TraversalFlag,
50 boost::use_default
51 >
52 >
53 {
54 // Define operator cast to Iterator to be able to write things like Iterator it = myit++
55 inline operator Iterator() const
56 {
57 return this->base();
58 }
59
60 /*inline bool operator==(Iterator const& other) const
61 {
62 return this->base() == other;
63 }
64 inline bool operator!=(Iterator const& other) const
65 {
66 return ! operator==(other);
67 }*/
68 };
69
70 }}}} // namespace boost::geometry::detail::iterators
71 #endif
72
73
74 #endif // BOOST_GEOMETRY_ITERATORS_DETAIL_ITERATOR_BASE_HPP