1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
7 // This file was modified by Oracle on 2014-2021.
8 // Modifications copyright (c) 2014-2021, Oracle and/or its affiliates.
9 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
10 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
12 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
13 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
15 // Use, modification and distribution is subject to the Boost Software License,
16 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
17 // http://www.boost.org/LICENSE_1_0.txt)
19 #ifndef BOOST_GEOMETRY_STRATEGIES_DEFAULT_LENGTH_RESULT_HPP
20 #define BOOST_GEOMETRY_STRATEGIES_DEFAULT_LENGTH_RESULT_HPP
23 #include <boost/geometry/algorithms/detail/select_geometry_type.hpp>
24 #include <boost/geometry/core/coordinate_type.hpp>
25 #include <boost/geometry/util/select_most_precise.hpp>
26 #include <boost/geometry/util/type_traits.hpp>
29 namespace boost { namespace geometry
33 namespace resolve_strategy
36 // NOTE: The implementation was simplified greately preserving the old
37 // behavior. In general case the result types of Strategies should be
38 // taken into account.
39 // It would probably be enough to use distance_result and
40 // default_distance_result here.
42 } // namespace resolve_strategy
45 namespace resolve_dynamic
48 template <typename Sequence>
49 struct default_length_result_impl;
51 template <typename ...Geometries>
52 struct default_length_result_impl<util::type_sequence<Geometries...>>
54 using type = typename select_most_precise
56 typename coordinate_type<Geometries>::type...,
61 template <typename Geometry>
62 struct default_length_result
63 : default_length_result_impl<typename detail::geometry_types<Geometry>::type>
67 } // namespace resolve_dynamic
71 \brief Meta-function defining return type of length function
73 \note Length of a line of integer coordinates can be double.
74 So we take at least a double. If Big Number types are used,
78 template <typename Geometry>
79 struct default_length_result
80 : resolve_dynamic::default_length_result<Geometry>
84 }} // namespace boost::geometry
86 #endif // BOOST_GEOMETRY_STRATEGIES_DEFAULT_LENGTH_RESULT_HPP