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 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
8 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
10 // Use, modification and distribution is subject to the Boost Software License,
11 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
12 // http://www.boost.org/LICENSE_1_0.txt)
14 #ifndef BOOST_GEOMETRY_CORE_MUTABLE_RANGE_HPP
15 #define BOOST_GEOMETRY_CORE_MUTABLE_RANGE_HPP
20 #include <boost/range/value_type.hpp>
21 #include <boost/type_traits/remove_reference.hpp>
24 namespace boost { namespace geometry
32 \brief Metafunction to define the argument passed to the three
33 traits classes clear, push_back and resize
34 \ingroup mutable_range
36 template <typename Range>
39 typedef typename boost::remove_reference<Range>::type& type;
44 \brief Traits class to clear a geometry
45 \ingroup mutable_range
47 template <typename Range>
50 static inline void apply(typename rvalue_type<Range>::type range)
58 \brief Traits class to append a point to a range (ring, linestring, multi*)
59 \ingroup mutable_range
61 template <typename Range>
64 typedef typename boost::range_value
66 typename boost::remove_reference<Range>::type
69 static inline void apply(typename rvalue_type<Range>::type range,
70 item_type const& item)
72 range.push_back(item);
78 \brief Traits class to append a point to a range (ring, linestring, multi*)
79 \ingroup mutable_range
81 template <typename Range>
84 static inline void apply(typename rvalue_type<Range>::type range,
87 range.resize(new_size);
95 }} // namespace boost::geometry
98 #endif // BOOST_GEOMETRY_CORE_MUTABLE_RANGE_HPP