update boost
This commit is contained in:
@@ -4,6 +4,9 @@
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// Copyright (c) 2020-2021, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
@@ -14,10 +17,16 @@
|
||||
#ifndef BOOST_GEOMETRY_ITERATORS_CLOSING_ITERATOR_HPP
|
||||
#define BOOST_GEOMETRY_ITERATORS_CLOSING_ITERATOR_HPP
|
||||
|
||||
#include <boost/range.hpp>
|
||||
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
#include <boost/iterator/iterator_categories.hpp>
|
||||
#include <boost/range/begin.hpp>
|
||||
#include <boost/range/end.hpp>
|
||||
#include <boost/range/difference_type.hpp>
|
||||
#include <boost/range/reference.hpp>
|
||||
#include <boost/range/value_type.hpp>
|
||||
|
||||
#include <boost/geometry/core/assert.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
@@ -58,31 +67,52 @@ public:
|
||||
typedef typename base_type::difference_type difference_type;
|
||||
|
||||
/// Constructor including the range it is based on
|
||||
explicit inline closing_iterator(Range& range)
|
||||
: m_range(&range)
|
||||
, m_iterator(boost::begin(range))
|
||||
explicit inline closing_iterator(Range const& range)
|
||||
: m_iterator(boost::begin(range))
|
||||
, m_begin(boost::begin(range))
|
||||
, m_end(boost::end(range))
|
||||
, m_size(static_cast<difference_type>(boost::size(range)))
|
||||
, m_size(m_end - m_begin)
|
||||
, m_index(0)
|
||||
{}
|
||||
|
||||
/// Constructor to indicate the end of a range
|
||||
explicit inline closing_iterator(Range& range, bool)
|
||||
: m_range(&range)
|
||||
, m_iterator(boost::end(range))
|
||||
explicit inline closing_iterator(Range const& range, bool)
|
||||
: m_iterator(boost::end(range))
|
||||
, m_begin(boost::begin(range))
|
||||
, m_end(boost::end(range))
|
||||
, m_size(static_cast<difference_type>(boost::size(range)))
|
||||
, m_size(m_end - m_begin)
|
||||
, m_index((m_size == 0) ? 0 : m_size + 1)
|
||||
{}
|
||||
|
||||
/// Default constructor
|
||||
explicit inline closing_iterator()
|
||||
: m_range(NULL)
|
||||
, m_size(0)
|
||||
inline closing_iterator()
|
||||
: m_size(0)
|
||||
, m_index(0)
|
||||
{}
|
||||
|
||||
template
|
||||
<
|
||||
typename OtherRange,
|
||||
std::enable_if_t
|
||||
<
|
||||
std::is_convertible
|
||||
<
|
||||
typename boost::range_iterator<OtherRange const>::type,
|
||||
typename boost::range_iterator<Range const>::type
|
||||
>::value,
|
||||
int
|
||||
> = 0
|
||||
>
|
||||
inline closing_iterator(closing_iterator<OtherRange> const& other)
|
||||
: m_iterator(other.m_iterator)
|
||||
, m_begin(other.m_begin)
|
||||
, m_end(other.m_end)
|
||||
, m_size(other.m_size)
|
||||
, m_index(other.m_index)
|
||||
{}
|
||||
|
||||
private:
|
||||
template <typename OtherRange> friend struct closing_iterator;
|
||||
friend class boost::iterator_core_access;
|
||||
|
||||
inline reference dereference() const
|
||||
@@ -97,8 +127,8 @@ private:
|
||||
|
||||
inline bool equal(closing_iterator<Range> const& other) const
|
||||
{
|
||||
return this->m_range == other.m_range
|
||||
&& this->m_index == other.m_index;
|
||||
BOOST_GEOMETRY_ASSERT(m_begin == other.m_begin && m_end == other.m_end);
|
||||
return this->m_index == other.m_index;
|
||||
}
|
||||
|
||||
inline void increment()
|
||||
@@ -142,14 +172,14 @@ private:
|
||||
inline void update_iterator()
|
||||
{
|
||||
this->m_iterator = m_index <= m_size
|
||||
? boost::begin(*m_range) + (m_index % m_size)
|
||||
: boost::end(*m_range)
|
||||
? m_begin + (m_index % m_size)
|
||||
: m_end
|
||||
;
|
||||
}
|
||||
|
||||
Range* m_range;
|
||||
typename boost::range_iterator<Range>::type m_iterator;
|
||||
typename boost::range_iterator<Range>::type m_end;
|
||||
typename boost::range_iterator<Range const>::type m_iterator;
|
||||
typename boost::range_iterator<Range const>::type m_begin;
|
||||
typename boost::range_iterator<Range const>::type m_end;
|
||||
difference_type m_size;
|
||||
difference_type m_index;
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
|
||||
// Copyright (c) 2014-2021, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
@@ -10,8 +10,9 @@
|
||||
#ifndef BOOST_GEOMETRY_ITERATORS_CONCATENATE_ITERATOR_HPP
|
||||
#define BOOST_GEOMETRY_ITERATORS_CONCATENATE_ITERATOR_HPP
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
#include <boost/iterator/iterator_categories.hpp>
|
||||
|
||||
@@ -46,7 +47,7 @@ public:
|
||||
typedef Iterator2 second_iterator_type;
|
||||
|
||||
// default constructor
|
||||
concatenate_iterator() {}
|
||||
concatenate_iterator() = default;
|
||||
|
||||
// for begin
|
||||
concatenate_iterator(Iterator1 it1, Iterator1 end1,
|
||||
@@ -64,7 +65,13 @@ public:
|
||||
typename OtherIt1,
|
||||
typename OtherIt2,
|
||||
typename OtherValue,
|
||||
typename OtherReference
|
||||
typename OtherReference,
|
||||
std::enable_if_t
|
||||
<
|
||||
std::is_convertible<OtherIt1, Iterator1>::value
|
||||
&& std::is_convertible<OtherIt2, Iterator2>::value,
|
||||
int
|
||||
> = 0
|
||||
>
|
||||
concatenate_iterator(concatenate_iterator
|
||||
<
|
||||
@@ -77,15 +84,11 @@ public:
|
||||
, m_end1(other.m_end1)
|
||||
, m_begin2(other.m_begin2)
|
||||
, m_it2(other.m_it2)
|
||||
{
|
||||
static const bool are_conv
|
||||
= boost::is_convertible<OtherIt1, Iterator1>::value
|
||||
&& boost::is_convertible<OtherIt2, Iterator2>::value;
|
||||
{}
|
||||
|
||||
BOOST_MPL_ASSERT_MSG((are_conv),
|
||||
NOT_CONVERTIBLE,
|
||||
(types<OtherIt1, OtherIt2>));
|
||||
}
|
||||
concatenate_iterator(concatenate_iterator const& other) = default;
|
||||
|
||||
concatenate_iterator& operator=(concatenate_iterator const& other) = default;
|
||||
|
||||
private:
|
||||
friend class boost::iterator_core_access;
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// Boost.Geometry
|
||||
|
||||
// Copyright (c) 2014-2021, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
|
||||
#ifndef BOOST_GEOMETRY_ITERATORS_DETAIL_HAS_ONE_ELEMENT_HPP
|
||||
#define BOOST_GEOMETRY_ITERATORS_DETAIL_HAS_ONE_ELEMENT_HPP
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace detail
|
||||
{
|
||||
|
||||
|
||||
// free function to test if an iterator range has a single element
|
||||
template <typename Iterator>
|
||||
inline bool has_one_element(Iterator first, Iterator last)
|
||||
{
|
||||
return first != last && ++first == last;
|
||||
}
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::detail
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_ITERATORS_DETAIL_HAS_ONE_ELEMENT_HPP
|
||||
@@ -4,6 +4,10 @@
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2020-2021.
|
||||
// Modifications copyright (c) 2020-2021 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
@@ -11,12 +15,13 @@
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_ITERATORS_BASE_HPP
|
||||
#define BOOST_GEOMETRY_ITERATORS_BASE_HPP
|
||||
#ifndef BOOST_GEOMETRY_ITERATORS_DETAIL_ITERATOR_BASE_HPP
|
||||
#define BOOST_GEOMETRY_ITERATORS_DETAIL_ITERATOR_BASE_HPP
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/iterator/iterator_adaptor.hpp>
|
||||
#include <boost/iterator/iterator_categories.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace boost { namespace geometry { namespace detail { namespace iterators
|
||||
@@ -34,16 +39,16 @@ struct iterator_base
|
||||
DerivedClass,
|
||||
Iterator,
|
||||
boost::use_default,
|
||||
typename boost::mpl::if_
|
||||
std::conditional_t
|
||||
<
|
||||
boost::is_convertible
|
||||
std::is_convertible
|
||||
<
|
||||
typename boost::iterator_traversal<Iterator>::type,
|
||||
boost::random_access_traversal_tag
|
||||
>,
|
||||
>::value,
|
||||
TraversalFlag,
|
||||
boost::use_default
|
||||
>::type
|
||||
>
|
||||
>
|
||||
{
|
||||
// Define operator cast to Iterator to be able to write things like Iterator it = myit++
|
||||
@@ -66,4 +71,4 @@ struct iterator_base
|
||||
#endif
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_ITERATORS_BASE_HPP
|
||||
#endif // BOOST_GEOMETRY_ITERATORS_DETAIL_ITERATOR_BASE_HPP
|
||||
@@ -1,8 +1,9 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2020, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
@@ -10,9 +11,9 @@
|
||||
#ifndef BOOST_GEOMETRY_ITERATORS_DETAIL_POINT_ITERATOR_INNER_RANGE_TYPE_HPP
|
||||
#define BOOST_GEOMETRY_ITERATORS_DETAIL_POINT_ITERATOR_INNER_RANGE_TYPE_HPP
|
||||
|
||||
#include <boost/range.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/range/value_type.hpp>
|
||||
|
||||
#include <boost/geometry/core/ring_type.hpp>
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
@@ -30,29 +31,29 @@ namespace detail { namespace point_iterator
|
||||
|
||||
template
|
||||
<
|
||||
typename Geometry,
|
||||
typename Geometry,
|
||||
typename Tag = typename tag<Geometry>::type
|
||||
>
|
||||
struct inner_range_type
|
||||
{
|
||||
typedef typename boost::mpl::if_c
|
||||
typedef std::conditional_t
|
||||
<
|
||||
!boost::is_const<Geometry>::type::value,
|
||||
! std::is_const<Geometry>::value,
|
||||
typename boost::range_value<Geometry>::type,
|
||||
typename boost::range_value<Geometry>::type const
|
||||
>::type type;
|
||||
> type;
|
||||
};
|
||||
|
||||
|
||||
template <typename Polygon>
|
||||
struct inner_range_type<Polygon, polygon_tag>
|
||||
{
|
||||
typedef typename boost::mpl::if_c
|
||||
typedef std::conditional_t
|
||||
<
|
||||
!boost::is_const<Polygon>::type::value,
|
||||
! std::is_const<Polygon>::value,
|
||||
typename geometry::ring_type<Polygon>::type,
|
||||
typename geometry::ring_type<Polygon>::type const
|
||||
>::type type;
|
||||
> type;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014, 2018, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2020, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
@@ -11,7 +11,7 @@
|
||||
#ifndef BOOST_GEOMETRY_ITERATORS_DETAIL_POINT_ITERATOR_ITERATOR_TYPE_HPP
|
||||
#define BOOST_GEOMETRY_ITERATORS_DETAIL_POINT_ITERATOR_ITERATOR_TYPE_HPP
|
||||
|
||||
#include <boost/range.hpp>
|
||||
#include <boost/range/iterator.hpp>
|
||||
|
||||
#include <boost/geometry/core/interior_type.hpp>
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2020, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
@@ -10,8 +11,8 @@
|
||||
#ifndef BOOST_GEOMETRY_ITERATORS_DETAIL_POINT_ITERATOR_VALUE_TYPE_HPP
|
||||
#define BOOST_GEOMETRY_ITERATORS_DETAIL_POINT_ITERATOR_VALUE_TYPE_HPP
|
||||
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
|
||||
@@ -28,12 +29,12 @@ namespace detail { namespace point_iterator
|
||||
template <typename Geometry>
|
||||
struct value_type
|
||||
{
|
||||
typedef typename boost::mpl::if_c
|
||||
typedef std::conditional_t
|
||||
<
|
||||
!boost::is_const<Geometry>::type::value,
|
||||
! std::is_const<Geometry>::value,
|
||||
typename geometry::point_type<Geometry>::type,
|
||||
typename geometry::point_type<Geometry>::type const
|
||||
>::type type;
|
||||
> type;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2020, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
@@ -10,7 +11,7 @@
|
||||
#ifndef BOOST_GEOMETRY_ITERATORS_DETAIL_SEGMENT_ITERATOR_ITERATOR_TYPE_HPP
|
||||
#define BOOST_GEOMETRY_ITERATORS_DETAIL_SEGMENT_ITERATOR_ITERATOR_TYPE_HPP
|
||||
|
||||
#include <boost/range.hpp>
|
||||
#include <boost/range/iterator.hpp>
|
||||
|
||||
#include <boost/geometry/core/interior_type.hpp>
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
|
||||
// Copyright (c) 2014-2020, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
@@ -10,13 +10,17 @@
|
||||
#ifndef BOOST_GEOMETRY_ITERATORS_DETAIL_SEGMENT_ITERATOR_RANGE_SEGMENT_ITERATOR_HPP
|
||||
#define BOOST_GEOMETRY_ITERATORS_DETAIL_SEGMENT_ITERATOR_RANGE_SEGMENT_ITERATOR_HPP
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
#include <boost/iterator/iterator_categories.hpp>
|
||||
#include <boost/range.hpp>
|
||||
#include <boost/range/begin.hpp>
|
||||
#include <boost/range/end.hpp>
|
||||
#include <boost/range/size.hpp>
|
||||
|
||||
#include <boost/geometry/core/closure.hpp>
|
||||
#include <boost/geometry/core/static_assert.hpp>
|
||||
#include <boost/geometry/iterators/closing_iterator.hpp>
|
||||
|
||||
|
||||
@@ -150,9 +154,11 @@ public:
|
||||
>::iterator_type other_iterator_type;
|
||||
|
||||
static const bool are_conv
|
||||
= boost::is_convertible<other_iterator_type, iterator_type>::value;
|
||||
= std::is_convertible<other_iterator_type, iterator_type>::value;
|
||||
|
||||
BOOST_MPL_ASSERT_MSG((are_conv), NOT_CONVERTIBLE, (types<OtherRange>));
|
||||
BOOST_GEOMETRY_STATIC_ASSERT((are_conv),
|
||||
"Other iterator has to be convertible to member iterator.",
|
||||
OtherRange);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014-2015, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2020, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
@@ -12,14 +13,10 @@
|
||||
|
||||
#include <iterator>
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
|
||||
#include <boost/geometry/iterators/point_iterator.hpp>
|
||||
#include <boost/geometry/util/bare_type.hpp>
|
||||
#include <boost/geometry/geometries/segment.hpp>
|
||||
#include <boost/geometry/geometries/pointing_segment.hpp>
|
||||
|
||||
#include <boost/geometry/iterators/point_iterator.hpp>
|
||||
#include <boost/geometry/util/type_traits_std.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
@@ -49,18 +46,18 @@ struct value_type
|
||||
// it would store pointers to temporary objects. Instead we use a
|
||||
// segment, which does a full copy of the temporary objects
|
||||
// returned by the point iterator.
|
||||
typedef typename boost::mpl::if_
|
||||
typedef std::conditional_t
|
||||
<
|
||||
boost::is_reference<point_iterator_reference_type>,
|
||||
std::is_reference<point_iterator_reference_type>::value,
|
||||
geometry::model::pointing_segment<point_iterator_value_type>,
|
||||
geometry::model::segment
|
||||
<
|
||||
typename geometry::util::bare_type
|
||||
typename util::remove_cptrref
|
||||
<
|
||||
point_iterator_value_type
|
||||
>::type
|
||||
>
|
||||
>::type type;
|
||||
> type;
|
||||
};
|
||||
|
||||
}} // namespace detail::segment_iterator
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2020-2021.
|
||||
// Modifications copyright (c) 2020-2021 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
@@ -14,11 +18,21 @@
|
||||
#ifndef BOOST_GEOMETRY_ITERATORS_EVER_CIRCLING_ITERATOR_HPP
|
||||
#define BOOST_GEOMETRY_ITERATORS_EVER_CIRCLING_ITERATOR_HPP
|
||||
|
||||
#include <boost/range.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/iterator/iterator_adaptor.hpp>
|
||||
#include <boost/iterator/iterator_categories.hpp>
|
||||
#include <boost/range/begin.hpp>
|
||||
#include <boost/range/difference_type.hpp>
|
||||
#include <boost/range/reference.hpp>
|
||||
#include <boost/range/size.hpp>
|
||||
#include <boost/range/value_type.hpp>
|
||||
|
||||
#include <boost/geometry/core/assert.hpp>
|
||||
|
||||
#include <boost/geometry/iterators/detail/iterator_base.hpp>
|
||||
|
||||
#include <boost/geometry/iterators/base.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
@@ -41,7 +55,7 @@ struct ever_circling_iterator :
|
||||
Iterator
|
||||
>
|
||||
{
|
||||
friend class boost::iterator_core_access;
|
||||
ever_circling_iterator() = default;
|
||||
|
||||
explicit inline ever_circling_iterator(Iterator begin, Iterator end,
|
||||
bool skip_first = false)
|
||||
@@ -61,6 +75,17 @@ struct ever_circling_iterator :
|
||||
this->base_reference() = start;
|
||||
}
|
||||
|
||||
template
|
||||
<
|
||||
typename OtherIterator,
|
||||
std::enable_if_t<std::is_convertible<OtherIterator, Iterator>::value, int> = 0
|
||||
>
|
||||
inline ever_circling_iterator(ever_circling_iterator<OtherIterator> const& other)
|
||||
: m_begin(other.m_begin)
|
||||
, m_end(other.m_end)
|
||||
, m_skip_first(other.m_skip_first)
|
||||
{}
|
||||
|
||||
/// Navigate to a certain position, should be in [start .. end], if at end
|
||||
/// it will circle again.
|
||||
inline void moveto(Iterator it)
|
||||
@@ -70,6 +95,8 @@ struct ever_circling_iterator :
|
||||
}
|
||||
|
||||
private:
|
||||
template <typename OtherIterator> friend struct ever_circling_iterator;
|
||||
friend class boost::iterator_core_access;
|
||||
|
||||
inline void increment(bool possibly_skip = true)
|
||||
{
|
||||
@@ -117,8 +144,8 @@ private:
|
||||
|
||||
public:
|
||||
/// Constructor including the range it is based on
|
||||
explicit inline ever_circling_range_iterator(Range& range)
|
||||
: m_range(&range)
|
||||
explicit inline ever_circling_range_iterator(Range const& range)
|
||||
: m_begin(boost::begin(range))
|
||||
, m_iterator(boost::begin(range))
|
||||
, m_size(boost::size(range))
|
||||
, m_index(0)
|
||||
@@ -126,15 +153,35 @@ public:
|
||||
|
||||
/// Default constructor
|
||||
explicit inline ever_circling_range_iterator()
|
||||
: m_range(NULL)
|
||||
, m_size(0)
|
||||
: m_size(0)
|
||||
, m_index(0)
|
||||
{}
|
||||
|
||||
template
|
||||
<
|
||||
typename OtherRange,
|
||||
std::enable_if_t
|
||||
<
|
||||
std::is_convertible
|
||||
<
|
||||
typename boost::range_iterator<OtherRange const>::type,
|
||||
typename boost::range_iterator<Range const>::type
|
||||
>::value,
|
||||
int
|
||||
> = 0
|
||||
>
|
||||
inline ever_circling_range_iterator(ever_circling_range_iterator<OtherRange> const& other)
|
||||
: m_begin(other.m_begin)
|
||||
, m_iterator(other.m_iterator)
|
||||
, m_size(other.m_size)
|
||||
, m_index(other.m_index)
|
||||
{}
|
||||
|
||||
typedef typename base_type::reference reference;
|
||||
typedef typename base_type::difference_type difference_type;
|
||||
|
||||
private:
|
||||
template <typename OtherRange> friend struct ever_circling_range_iterator;
|
||||
friend class boost::iterator_core_access;
|
||||
|
||||
inline reference dereference() const
|
||||
@@ -149,8 +196,8 @@ private:
|
||||
|
||||
inline bool equal(ever_circling_range_iterator<Range> const& other) const
|
||||
{
|
||||
return this->m_range == other.m_range
|
||||
&& this->m_index == other.m_index;
|
||||
BOOST_GEOMETRY_ASSERT(m_begin == other.m_begin);
|
||||
return this->m_index == other.m_index;
|
||||
}
|
||||
|
||||
inline void increment()
|
||||
@@ -201,11 +248,11 @@ private:
|
||||
m_index += m_size;
|
||||
}
|
||||
m_index = m_index % m_size;
|
||||
this->m_iterator = boost::begin(*m_range) + m_index;
|
||||
this->m_iterator = m_begin + m_index;
|
||||
}
|
||||
|
||||
Range* m_range;
|
||||
typename boost::range_iterator<Range>::type m_iterator;
|
||||
typename boost::range_iterator<Range const>::type m_begin;
|
||||
typename boost::range_iterator<Range const>::type m_iterator;
|
||||
difference_type m_size;
|
||||
difference_type m_index;
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
|
||||
// Copyright (c) 2014-2021, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
@@ -10,13 +10,15 @@
|
||||
#ifndef BOOST_GEOMETRY_ITERATORS_FLATTEN_ITERATOR_HPP
|
||||
#define BOOST_GEOMETRY_ITERATORS_FLATTEN_ITERATOR_HPP
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
#include <boost/iterator/iterator_categories.hpp>
|
||||
|
||||
#include <boost/geometry/core/assert.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
@@ -57,7 +59,7 @@ public:
|
||||
typedef InnerIterator inner_iterator_type;
|
||||
|
||||
// default constructor
|
||||
flatten_iterator() {}
|
||||
flatten_iterator() = default;
|
||||
|
||||
// for begin
|
||||
flatten_iterator(OuterIterator outer_it, OuterIterator outer_end)
|
||||
@@ -76,7 +78,13 @@ public:
|
||||
typename OtherOuterIterator, typename OtherInnerIterator,
|
||||
typename OtherValue,
|
||||
typename OtherAccessInnerBegin, typename OtherAccessInnerEnd,
|
||||
typename OtherReference
|
||||
typename OtherReference,
|
||||
std::enable_if_t
|
||||
<
|
||||
std::is_convertible<OtherOuterIterator, OuterIterator>::value
|
||||
&& std::is_convertible<OtherInnerIterator, InnerIterator>::value,
|
||||
int
|
||||
> = 0
|
||||
>
|
||||
flatten_iterator(flatten_iterator
|
||||
<
|
||||
@@ -90,21 +98,9 @@ public:
|
||||
: m_outer_it(other.m_outer_it),
|
||||
m_outer_end(other.m_outer_end),
|
||||
m_inner_it(other.m_inner_it)
|
||||
{
|
||||
static const bool are_conv
|
||||
= boost::is_convertible
|
||||
<
|
||||
OtherOuterIterator, OuterIterator
|
||||
>::value
|
||||
&& boost::is_convertible
|
||||
<
|
||||
OtherInnerIterator, InnerIterator
|
||||
>::value;
|
||||
{}
|
||||
|
||||
BOOST_MPL_ASSERT_MSG((are_conv),
|
||||
NOT_CONVERTIBLE,
|
||||
(types<OtherOuterIterator, OtherInnerIterator>));
|
||||
}
|
||||
flatten_iterator(flatten_iterator const& other) = default;
|
||||
|
||||
flatten_iterator& operator=(flatten_iterator const& other)
|
||||
{
|
||||
@@ -215,7 +211,7 @@ private:
|
||||
}
|
||||
while ( empty(m_outer_it) );
|
||||
m_inner_it = AccessInnerEnd::apply(*m_outer_it);
|
||||
}
|
||||
}
|
||||
--m_inner_it;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
|
||||
#ifndef BOOST_GEOMETRY_ITERATORS_HAS_ONE_ELEMENT_HPP
|
||||
#define BOOST_GEOMETRY_ITERATORS_HAS_ONE_ELEMENT_HPP
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
// free function to test if an iterator range has a single element
|
||||
template <typename Iterator>
|
||||
inline bool has_one_element(Iterator first, Iterator beyond)
|
||||
{
|
||||
return first != beyond && ++first == beyond;
|
||||
}
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_ITERATORS_HAS_ONE_ELEMENT_HPP
|
||||
@@ -1,8 +1,8 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
|
||||
// Copyright (c) 2014-2021, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
@@ -10,10 +10,12 @@
|
||||
#ifndef BOOST_GEOMETRY_ITERATORS_POINT_ITERATOR_HPP
|
||||
#define BOOST_GEOMETRY_ITERATORS_POINT_ITERATOR_HPP
|
||||
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/iterator/iterator_adaptor.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/range.hpp>
|
||||
#include <boost/range/begin.hpp>
|
||||
#include <boost/range/end.hpp>
|
||||
|
||||
#include <boost/geometry/core/exterior_ring.hpp>
|
||||
#include <boost/geometry/core/interior_rings.hpp>
|
||||
@@ -260,28 +262,24 @@ private:
|
||||
: point_iterator::iterator_adaptor_(base_it) {}
|
||||
|
||||
public:
|
||||
inline point_iterator() {}
|
||||
inline point_iterator() = default;
|
||||
|
||||
template <typename OtherGeometry>
|
||||
template
|
||||
<
|
||||
typename OtherGeometry,
|
||||
std::enable_if_t
|
||||
<
|
||||
std::is_convertible
|
||||
<
|
||||
typename detail::point_iterator::iterator_type<OtherGeometry>::type,
|
||||
typename detail::point_iterator::iterator_type<Geometry>::type
|
||||
>::value,
|
||||
int
|
||||
> = 0
|
||||
>
|
||||
inline point_iterator(point_iterator<OtherGeometry> const& other)
|
||||
: point_iterator::iterator_adaptor_(other.base())
|
||||
{
|
||||
static const bool is_conv
|
||||
= boost::is_convertible<
|
||||
typename detail::point_iterator::iterator_type
|
||||
<
|
||||
OtherGeometry
|
||||
>::type,
|
||||
typename detail::point_iterator::iterator_type
|
||||
<
|
||||
Geometry
|
||||
>::type
|
||||
>::value;
|
||||
|
||||
BOOST_MPL_ASSERT_MSG((is_conv),
|
||||
NOT_CONVERTIBLE,
|
||||
(point_iterator<OtherGeometry>));
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
|
||||
// Copyright (c) 2014-2021, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
@@ -11,9 +11,7 @@
|
||||
#define BOOST_GEOMETRY_ITERATORS_POINT_REVERSE_ITERATOR_HPP
|
||||
|
||||
#include <iterator>
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/geometry/iterators/point_iterator.hpp>
|
||||
|
||||
@@ -40,23 +38,24 @@ private:
|
||||
: base_type(base_it) {}
|
||||
|
||||
public:
|
||||
inline point_reverse_iterator() {}
|
||||
inline point_reverse_iterator() = default;
|
||||
|
||||
template <typename OtherGeometry>
|
||||
inline
|
||||
point_reverse_iterator(point_reverse_iterator<OtherGeometry> const& other)
|
||||
: base_type(other.base())
|
||||
{
|
||||
static const bool is_conv = boost::is_convertible
|
||||
template
|
||||
<
|
||||
typename OtherGeometry,
|
||||
std::enable_if_t
|
||||
<
|
||||
std::reverse_iterator<point_iterator<Geometry> >,
|
||||
std::reverse_iterator<point_iterator<OtherGeometry> >
|
||||
>::value;
|
||||
|
||||
BOOST_MPL_ASSERT_MSG((is_conv),
|
||||
NOT_CONVERTIBLE,
|
||||
(point_reverse_iterator<OtherGeometry>));
|
||||
}
|
||||
std::is_convertible
|
||||
<
|
||||
std::reverse_iterator<point_iterator<OtherGeometry> >,
|
||||
std::reverse_iterator<point_iterator<Geometry> >
|
||||
>::value,
|
||||
int
|
||||
> = 0
|
||||
>
|
||||
inline point_reverse_iterator(point_reverse_iterator<OtherGeometry> const& other)
|
||||
: base_type(other.base())
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
|
||||
// Copyright (c) 2014-2021, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
@@ -10,9 +10,11 @@
|
||||
#ifndef BOOST_GEOMETRY_ITERATORS_SEGMENT_ITERATOR_HPP
|
||||
#define BOOST_GEOMETRY_ITERATORS_SEGMENT_ITERATOR_HPP
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/range.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/range/begin.hpp>
|
||||
#include <boost/range/end.hpp>
|
||||
|
||||
#include <boost/geometry/core/exterior_ring.hpp>
|
||||
#include <boost/geometry/core/interior_rings.hpp>
|
||||
@@ -282,25 +284,24 @@ public:
|
||||
// correct iterator category.
|
||||
typedef std::bidirectional_iterator_tag iterator_category;
|
||||
|
||||
inline segment_iterator() {}
|
||||
inline segment_iterator() = default;
|
||||
|
||||
template <typename OtherGeometry>
|
||||
template
|
||||
<
|
||||
typename OtherGeometry,
|
||||
std::enable_if_t
|
||||
<
|
||||
std::is_convertible
|
||||
<
|
||||
typename detail::segment_iterator::iterator_type<OtherGeometry>::type,
|
||||
typename detail::segment_iterator::iterator_type<Geometry>::type
|
||||
>::value,
|
||||
int
|
||||
> = 0
|
||||
>
|
||||
inline segment_iterator(segment_iterator<OtherGeometry> const& other)
|
||||
: base(*other.base_ptr())
|
||||
{
|
||||
static const bool is_conv
|
||||
= boost::is_convertible<
|
||||
typename detail::segment_iterator::iterator_type
|
||||
<
|
||||
OtherGeometry
|
||||
>::type,
|
||||
typename detail::segment_iterator::iterator_type<Geometry>::type
|
||||
>::value;
|
||||
|
||||
BOOST_MPL_ASSERT_MSG((is_conv),
|
||||
NOT_CONVERTIBLE,
|
||||
(segment_iterator<OtherGeometry>));
|
||||
}
|
||||
{}
|
||||
|
||||
inline segment_iterator& operator++() // prefix
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user