9 #ifndef BOOST_GEOMETRY_INDEX_EQUAL_TO_HPP
10 #define BOOST_GEOMETRY_INDEX_EQUAL_TO_HPP
12 #include <boost/geometry/algorithms/equals.hpp>
13 #include <boost/geometry/index/indexable.hpp>
15 namespace boost {
namespace geometry {
namespace index {
namespace detail {
17 template <
typename Geometry,
18 typename Tag =
typename geometry::tag<Geometry>::type>
21 inline static bool apply(Geometry
const& g1, Geometry
const& g2)
23 return geometry::equals(g1, g2);
27 template <
typename Geometry,
typename Tag>
28 struct equals<Geometry *, Tag>
30 inline static bool apply(
const Geometry * g1,
const Geometry * g2)
37 struct equals<T, void>
39 inline static bool apply(T
const& v1, T
const& v2)
45 template <
typename Tuple,
size_t I,
size_t N>
48 inline static bool apply(Tuple
const& t1, Tuple
const& t2)
50 typedef typename boost::tuples::element<I, Tuple>::type T;
52 return equals<T>::apply(boost::get<I>(t1), boost::get<I>(t2))
53 && tuple_equals<Tuple, I+1, N>::apply(t1, t2);
57 template <
typename Tuple,
size_t I>
58 struct tuple_equals<Tuple, I, I>
60 inline static bool apply(Tuple
const&, Tuple
const&)
82 template <
typename Value,
83 bool IsIndexable = is_indexable<Value>::value>
96 inline bool operator()(Value
const& l, Value
const& r)
const
98 return detail::equals<Value>::apply(l ,r);
111 template <
typename T1,
typename T2>
124 inline bool operator()(std::pair<T1, T2>
const& l, std::pair<T1, T2>
const& r)
const
126 return detail::equals<T1>::apply(l.first, r.first)
127 && detail::equals<T2>::apply(l.second, r.second);
137 template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
138 typename T5,
typename T6,
typename T7,
typename T8,
typename T9>
139 struct equal_to<boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>, false>
141 typedef boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> value_type;
153 inline bool operator()(value_type
const& l, value_type
const& r)
const
155 return detail::tuple_equals<
156 value_type, 0, boost::tuples::length<value_type>::value
163 #if !defined(BOOST_NO_CXX11_HDR_TUPLE) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
167 namespace boost {
namespace geometry {
namespace index {
namespace detail {
169 template <
typename Tuple,
size_t I,
size_t N>
170 struct std_tuple_equals
172 inline static bool apply(Tuple
const& t1, Tuple
const& t2)
174 typedef typename std::tuple_element<I, Tuple>::type T;
176 return equals<T>::apply(std::get<I>(t1), std::get<I>(t2))
177 && std_tuple_equals<Tuple, I+1, N>::apply(t1, t2);
181 template <
typename Tuple,
size_t I>
182 struct std_tuple_equals<Tuple, I, I>
184 inline static bool apply(Tuple
const&, Tuple
const&)
197 template <
typename ...Args>
200 typedef std::tuple<Args...> value_type;
212 bool operator()(value_type
const& l, value_type
const& r)
const
214 return detail::std_tuple_equals<
215 value_type, 0, std::tuple_size<value_type>::value
222 #endif // !defined(BOOST_NO_CXX11_HDR_TUPLE) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
224 namespace boost {
namespace geometry {
namespace index {
236 template <
typename Value>
258 #endif // BOOST_GEOMETRY_INDEX_EQUAL_TO_HPP
bool operator()(Value const &l, Value const &r) const
Compare values. If Value is a Geometry geometry::equals() function is used.
Definition: equal_to.hpp:96
detail::equal_to< Value >::result_type result_type
The type of result returned by function object.
Definition: equal_to.hpp:241
boost::geometry::index::detail::equal_to< boost::tuple< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >, false >::result_type bool result_type
The type of result returned by function object.
Definition: equal_to.hpp:144
The function object comparing Values.
Definition: equal_to.hpp:84
bool operator()(value_type const &l, value_type const &r) const
Compare values. If tuple<> Value member is a Geometry geometry::equals() function is used...
Definition: equal_to.hpp:212
boost::geometry::index::detail::equal_to< boost::tuple< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >, false >::operator() bool operator()(value_type const &l, value_type const &r) const
Compare values. If tuple<> Value member is a Geometry geometry::equals() function is used...
Definition: equal_to.hpp:153
The function object comparing Values.
Definition: equal_to.hpp:237
bool result_type
The type of result returned by function object.
Definition: equal_to.hpp:115
bool operator()(Value const &l, Value const &r) const
Compare Values.
Definition: equal_to.hpp:250
bool operator()(std::pair< T1, T2 > const &l, std::pair< T1, T2 > const &r) const
Compare values. If pair<> Value member is a Geometry geometry::equals() function is used...
Definition: equal_to.hpp:124
bool result_type
The type of result returned by function object.
Definition: equal_to.hpp:87
bool result_type
The type of result returned by function object.
Definition: equal_to.hpp:203