File indexing completed on 2025-01-18 09:36:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_GEOMETRY_STRATEGIES_DISTANCE_COMPARABLE_HPP
0011 #define BOOST_GEOMETRY_STRATEGIES_DISTANCE_COMPARABLE_HPP
0012
0013
0014 #include <boost/geometry/core/cs.hpp>
0015 #include <boost/geometry/core/static_assert.hpp>
0016
0017 #include <boost/geometry/strategies/distance.hpp>
0018
0019
0020 namespace boost { namespace geometry
0021 {
0022
0023 namespace strategies { namespace distance
0024 {
0025
0026 #ifndef DOXYGEN_NO_DETAIL
0027 namespace detail
0028 {
0029
0030 template <typename Strategies>
0031 struct comparable
0032 : public Strategies
0033 {
0034 comparable() = default;
0035
0036 explicit comparable(Strategies const& strategies)
0037 : Strategies(strategies)
0038 {}
0039
0040 template <typename Geometry1, typename Geometry2>
0041 auto distance(Geometry1 const& g1, Geometry2 const& g2) const
0042 {
0043 return strategy::distance::services::get_comparable
0044 <
0045 decltype(Strategies::distance(g1, g2))
0046 >::apply(Strategies::distance(g1, g2));
0047 }
0048 };
0049
0050 template <typename Strategies>
0051 inline comparable<Strategies> make_comparable(Strategies const& strategies)
0052 {
0053 return comparable<Strategies>(strategies);
0054 }
0055
0056 }
0057 #endif
0058
0059 }}
0060
0061 }}
0062
0063 #endif