Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83302 - in sandbox-branches/geometry/index: boost/geometry/index boost/geometry/index/detail/rtree/node test/rtree
From: adam.wulkiewicz_at_[hidden]
Date: 2013-03-04 21:42:04


Author: awulkiew
Date: 2013-03-04 21:42:02 EST (Mon, 04 Mar 2013)
New Revision: 83302
URL: http://svn.boost.org/trac/boost/changeset/83302

Log:
Added commented out specializations of insexable<>, equal_to<> and tests for std::tuple.
Removed unneeded variant node get<> function.
Text files modified:
   sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/static_visitor.hpp | 10 ------
   sandbox-branches/geometry/index/boost/geometry/index/equal_to.hpp | 52 ++++++++++++++++++++++++++++++++++
   sandbox-branches/geometry/index/boost/geometry/index/indexable.hpp | 28 ++++++++++++++++++
   sandbox-branches/geometry/index/test/rtree/test_rtree.hpp | 60 ++++++++++++++++++++++++++++++++++++++++
   4 files changed, 140 insertions(+), 10 deletions(-)

Modified: sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/static_visitor.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/static_visitor.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/static_visitor.hpp 2013-03-04 21:42:02 EST (Mon, 04 Mar 2013)
@@ -37,16 +37,6 @@
     return boost::get<V>(v);
 }
 
-template <typename V, typename Value, typename Parameters, typename Box, typename Allocators, typename Tag>
-inline V * get(
- boost::variant<
- static_leaf<Value, Parameters, Box, Allocators, Tag>,
- static_internal_node<Value, Parameters, Box, Allocators, Tag>
- > *v)
-{
- return boost::get<V>(v);
-}
-
 // apply visitor
 
 template <typename Visitor, typename Value, typename Parameters, typename Box, typename Allocators, typename Tag>

Modified: sandbox-branches/geometry/index/boost/geometry/index/equal_to.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/index/equal_to.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/index/equal_to.hpp 2013-03-04 21:42:02 EST (Mon, 04 Mar 2013)
@@ -123,4 +123,56 @@
 
 }}} // namespace boost::geometry::index
 
+//#if !defined(BOOST_NO_CXX11_HDR_TUPLE) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+//
+//#include <tuple>
+//
+//namespace boost { namespace geometry { namespace index {
+//
+//namespace detail {
+//
+//template <typename Tuple, size_t I, size_t N>
+//struct std_tuple_equals
+//{
+// inline static bool apply(Tuple const& t1, Tuple const& t2)
+// {
+// typedef typename std::tuple_element<I, Tuple>::type T;
+// return
+// equals<
+// T, typename geometry::traits::tag<T>::type
+// >::apply(std::get<I>(t1), std::get<I>(t2))
+// &&
+// std_tuple_equals<Tuple, I+1, N>::apply(t1, t2);
+// }
+//};
+//
+//template <typename Tuple, size_t I>
+//struct std_tuple_equals<Tuple, I, I>
+//{
+// inline static bool apply(Tuple const&, Tuple const&)
+// {
+// return true;
+// }
+//};
+//
+//} // namespace detail
+//
+//template <typename ...Args>
+//struct equal_to< std::tuple<Args...> >
+//{
+// typedef std::tuple<Args...> value_type;
+//
+// typedef bool result_type;
+// bool operator()(value_type const& l, value_type const& r) const
+// {
+// return detail::std_tuple_equals<
+// value_type, 0, std::tuple_size<value_type>::value
+// >::apply(l ,r);
+// }
+//};
+//
+//}}} // namespace boost::geometry::index
+//
+//#endif // !defined(BOOST_NO_CXX11_HDR_TUPLE) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+
 #endif // BOOST_GEOMETRY_INDEX_EQUAL_TO_HPP

Modified: sandbox-branches/geometry/index/boost/geometry/index/indexable.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/index/indexable.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/index/indexable.hpp 2013-03-04 21:42:02 EST (Mon, 04 Mar 2013)
@@ -109,4 +109,32 @@
 
 }}} // namespace boost::geometry::index
 
+//#if !defined(BOOST_NO_CXX11_HDR_TUPLE) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+//
+//#include <tuple>
+//
+//namespace boost { namespace geometry { namespace index {
+//
+//template <typename Indexable, typename ...Args>
+//struct indexable< std::tuple<Indexable, Args...> >
+//{
+// typedef std::tuple<Indexable, Args...> value_type;
+//
+// BOOST_MPL_ASSERT_MSG(
+// (detail::is_indexable<Indexable>::value),
+// NOT_VALID_INDEXABLE_TYPE,
+// (Indexable)
+// );
+//
+// typedef Indexable const& result_type;
+// result_type operator()(value_type const& v) const
+// {
+// return std::get<0>(v);
+// }
+//};
+//
+//}}} // namespace boost::geometry::index
+//
+//#endif // !defined(BOOST_NO_CXX11_HDR_TUPLE) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+
 #endif // BOOST_GEOMETRY_INDEX_INDEXABLE_HPP

Modified: sandbox-branches/geometry/index/test/rtree/test_rtree.hpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/test_rtree.hpp (original)
+++ sandbox-branches/geometry/index/test/rtree/test_rtree.hpp 2013-03-04 21:42:02 EST (Mon, 04 Mar 2013)
@@ -196,6 +196,56 @@
     }
 };
 
+//#if !defined(BOOST_NO_CXX11_HDR_TUPLE) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+//
+//template <typename T, typename C>
+//struct generate_value< std::tuple<bg::model::point<T, 2, C>, int, int> >
+//{
+// typedef bg::model::point<T, 2, C> P;
+// typedef std::tuple<P, int, int> R;
+// static R apply(int x, int y)
+// {
+// return std::make_tuple(P(x, y), x + y * 100, 0);
+// }
+//};
+//
+//template <typename T, typename C>
+//struct generate_value< std::tuple<bg::model::box< bg::model::point<T, 2, C> >, int, int> >
+//{
+// typedef bg::model::point<T, 2, C> P;
+// typedef bg::model::box<P> B;
+// typedef std::tuple<B, int, int> R;
+// static R apply(int x, int y)
+// {
+// return std::make_tuple(B(P(x, y), P(x + 2, y + 3)), x + y * 100, 0);
+// }
+//};
+//
+//template <typename T, typename C>
+//struct generate_value< std::tuple<bg::model::point<T, 3, C>, int, int> >
+//{
+// typedef bg::model::point<T, 3, C> P;
+// typedef std::tuple<P, int, int> R;
+// static R apply(int x, int y, int z)
+// {
+// return std::make_tuple(P(x, y, z), x + y * 100 + z * 10000, 0);
+// }
+//};
+//
+//template <typename T, typename C>
+//struct generate_value< std::tuple<bg::model::box< bg::model::point<T, 3, C> >, int, int> >
+//{
+// typedef bg::model::point<T, 3, C> P;
+// typedef bg::model::box<P> B;
+// typedef std::tuple<B, int, int> R;
+// static R apply(int x, int y, int z)
+// {
+// return std::make_tuple(B(P(x, y, z), P(x + 2, y + 3, z + 4)), x + y * 100 + z * 10000, 0);
+// }
+//};
+//
+//#endif // #if !defined(BOOST_NO_CXX11_HDR_TUPLE) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+
 // shared_ptr value
 
 template <typename Indexable>
@@ -1346,6 +1396,11 @@
 
     test_rtree_count<Point>(parameters, allocator);
     test_rtree_bounds<Point>(parameters, allocator);
+
+//#if !defined(BOOST_NO_CXX11_HDR_TUPLE) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+// typedef std::tuple<Point, int, int> StdTupleP;
+// test_rtree_by_value<StdTupleP, Parameters>(parameters, allocator);
+//#endif
 }
 
 template<typename Point, typename Parameters, typename Allocator>
@@ -1366,6 +1421,11 @@
 
     test_rtree_count<Box>(parameters, allocator);
     test_rtree_bounds<Box>(parameters, allocator);
+
+//#if !defined(BOOST_NO_CXX11_HDR_TUPLE) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+// typedef std::tuple<Box, int, int> StdTupleB;
+// test_rtree_by_value<StdTupleB, Parameters>(parameters, allocator);
+//#endif
 }
 
 template<typename Point, typename Parameters>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk