]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/strategies/default_length_result.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / geometry / strategies / default_length_result.hpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2
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.
6
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
11
12 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
13 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
14
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)
18
19 #ifndef BOOST_GEOMETRY_STRATEGIES_DEFAULT_LENGTH_RESULT_HPP
20 #define BOOST_GEOMETRY_STRATEGIES_DEFAULT_LENGTH_RESULT_HPP
21
22
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>
27
28
29 namespace boost { namespace geometry
30 {
31
32
33 namespace resolve_strategy
34 {
35
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.
41
42 } // namespace resolve_strategy
43
44
45 namespace resolve_dynamic
46 {
47
48 template <typename Sequence>
49 struct default_length_result_impl;
50
51 template <typename ...Geometries>
52 struct default_length_result_impl<util::type_sequence<Geometries...>>
53 {
54 using type = typename select_most_precise
55 <
56 typename coordinate_type<Geometries>::type...,
57 long double
58 >::type;
59 };
60
61 template <typename Geometry>
62 struct default_length_result
63 : default_length_result_impl<typename detail::geometry_types<Geometry>::type>
64 {};
65
66
67 } // namespace resolve_dynamic
68
69
70 /*!
71 \brief Meta-function defining return type of length function
72 \ingroup length
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,
75 we take that type.
76
77 */
78 template <typename Geometry>
79 struct default_length_result
80 : resolve_dynamic::default_length_result<Geometry>
81 {};
82
83
84 }} // namespace boost::geometry
85
86 #endif // BOOST_GEOMETRY_STRATEGIES_DEFAULT_LENGTH_RESULT_HPP