]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/geometry/include/boost/geometry/strategies/default_length_result.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / geometry / include / boost / geometry / strategies / default_length_result.hpp
CommitLineData
7c673cae
FG
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.
8// Modifications copyright (c) 2014, Oracle and/or its affiliates.
9
10// Contributed and/or modified by Menelaos Karavelas, 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#include <boost/variant/variant_fwd.hpp>
23
24#include <boost/geometry/core/coordinate_type.hpp>
25
26#include <boost/geometry/util/compress_variant.hpp>
27#include <boost/geometry/util/select_most_precise.hpp>
28#include <boost/geometry/util/transform_variant.hpp>
29
30
31namespace boost { namespace geometry
32{
33
34
35namespace resolve_strategy
36{
37
38template <typename Geometry>
39struct default_length_result
40{
41 typedef typename select_most_precise
42 <
43 typename coordinate_type<Geometry>::type,
44 long double
45 >::type type;
46};
47
48} // namespace resolve_strategy
49
50
51namespace resolve_variant
52{
53
54template <typename Geometry>
55struct default_length_result
56 : resolve_strategy::default_length_result<Geometry>
57{};
58
59template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
60struct default_length_result<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
61{
62 typedef typename compress_variant<
63 typename transform_variant<
64 boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>,
65 resolve_strategy::default_length_result<boost::mpl::placeholders::_>
66 >::type
67 >::type type;
68};
69
70} // namespace resolve_variant
71
72
73/*!
74 \brief Meta-function defining return type of length function
75 \ingroup length
76 \note Length of a line of integer coordinates can be double.
77 So we take at least a double. If Big Number types are used,
78 we take that type.
79
80 */
81template <typename Geometry>
82struct default_length_result
83 : resolve_variant::default_length_result<Geometry>
84{};
85
86
87}} // namespace boost::geometry
88
89#endif // BOOST_GEOMETRY_STRATEGIES_DEFAULT_LENGTH_RESULT_HPP