// Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
-// This file was modified by Oracle on 2014-2020.
-// Modifications copyright (c) 2014-2020, Oracle and/or its affiliates.
-
+// This file was modified by Oracle on 2014-2021.
+// Modifications copyright (c) 2014-2021, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
+// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
#define BOOST_GEOMETRY_STRATEGIES_DEFAULT_LENGTH_RESULT_HPP
-#include <boost/variant/variant_fwd.hpp>
-
+#include <boost/geometry/algorithms/detail/select_geometry_type.hpp>
#include <boost/geometry/core/coordinate_type.hpp>
#include <boost/geometry/util/select_most_precise.hpp>
#include <boost/geometry/util/type_traits.hpp>
// It would probably be enough to use distance_result and
// default_distance_result here.
+} // namespace resolve_strategy
-// Workaround for VS2015
-#if defined(_MSC_VER) && (_MSC_VER < 1910)
-template
-<
- typename Geometry,
- bool IsGeometry = util::is_geometry<Geometry>::value
->
-struct coordinate_type
- : geometry::coordinate_type<Geometry>
-{};
-template <typename Geometry>
-struct coordinate_type<Geometry, false>
+
+namespace resolve_dynamic
{
- typedef long double type;
-};
-#endif
+
+template <typename Sequence>
+struct default_length_result_impl;
template <typename ...Geometries>
-struct default_length_result
+struct default_length_result_impl<util::type_sequence<Geometries...>>
{
- typedef typename select_most_precise
+ using type = typename select_most_precise
<
typename coordinate_type<Geometries>::type...,
long double
- >::type type;
+ >::type;
};
-} // namespace resolve_strategy
-
-
-namespace resolve_variant
-{
-
template <typename Geometry>
struct default_length_result
- : resolve_strategy::default_length_result<Geometry>
+ : default_length_result_impl<typename detail::geometry_types<Geometry>::type>
{};
-template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
-struct default_length_result<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
- : resolve_strategy::default_length_result<BOOST_VARIANT_ENUM_PARAMS(T)>
-{};
-} // namespace resolve_variant
+} // namespace resolve_dynamic
/*!
*/
template <typename Geometry>
struct default_length_result
- : resolve_variant::default_length_result<Geometry>
+ : resolve_dynamic::default_length_result<Geometry>
{};