1 // Boost.Geometry (aka GGL, Generic Geometry Library)
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.
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
11 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
12 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
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)
18 #ifndef BOOST_GEOMETRY_CORE_MUTABLE_RANGE_HPP
19 #define BOOST_GEOMETRY_CORE_MUTABLE_RANGE_HPP
23 #include <type_traits>
25 #include <boost/range/value_type.hpp>
28 namespace boost { namespace geometry
36 \brief Metafunction to define the argument passed to the three
37 traits classes clear, push_back and resize
38 \ingroup mutable_range
40 template <typename Range>
43 typedef typename std::remove_reference<Range>::type& type;
48 \brief Traits class to clear a geometry
49 \ingroup mutable_range
51 template <typename Range>
54 static inline void apply(typename rvalue_type<Range>::type range)
62 \brief Traits class to append a point to a range (ring, linestring, multi*)
63 \ingroup mutable_range
65 template <typename Range>
68 typedef typename boost::range_value
70 typename std::remove_reference<Range>::type
73 static inline void apply(typename rvalue_type<Range>::type range,
74 item_type const& item)
76 range.push_back(item);
82 \brief Traits class to append a point to a range (ring, linestring, multi*)
83 \ingroup mutable_range
85 template <typename Range>
88 static inline void apply(typename rvalue_type<Range>::type range,
91 range.resize(new_size);
99 }} // namespace boost::geometry
102 #endif // BOOST_GEOMETRY_CORE_MUTABLE_RANGE_HPP